bootmail: A Linux Bash script made for sending a mail about system boot.
Type Package name Description
=========== ============ ===========
mail client mail
mailx
mutt
smtp server sendmail *optional (required when you sending out from localhost)
boot logger bootlogd *optional (only works with mutt)
Run AutoInstaller
$ wget https://raw.githubusercontent.com/kdzlvaids/bootmail/master/install.sh
$ chmod 755 install.sh
$ sudo ./install.sh
# Download script
$ git clone [email protected]:kdzlvaids/bootmail.git
# or
$ git clone https://github.com/kdzlvaids/bootmail.git
# Install script
$ chmod 755 bootmail/bin/bootmail
$ sudo cp bootmail/bin/bootmail /etc/init.d/
$ sudo update-rc.d bootmail start 99 2 . stop 99 0 1 6 .
# optional: Install mutt mail client
$ sudo apt-get install mutt
# optional: Install bootlogd (Debian boot logger)
$ sudo apt-get install bootlogd
$ sudo echo "BOOTLOGD_ENABLE=yes" >>/etc/default/bootlogd
$ sudo echo "ENABLE_BOOTLOG=yes" >>/etc/default/bootmail
# optional: Make /etc/default/bootmail
MAILTO="root" # "To:" mail address (Default is 'root' in your local machine)
MAILFROM="$(id -n -u)@$(hostname -f)" # "From:" mail address
MAILCLIENT="mailx" # Mail client: mutt/mail/mailx
LOGDIR="/var/log" # Log directory
LOGFILE="$LOGDIR/bootmail.log" # Log file location
ENABLE_BOOTLOG="no" # Attach a boot record into the boot up mail
BOOTLOGFILE="/var/log/boot" # Bootlog attachment location
# Method 1: Run as InitScript
$ sudo service bootmail {start|stop}
# Method 2: Run manually
# bootmail will send an email automatically, so do not run manually.
bootmail [-h] {start|stop} [email address]
Arguments:
start system boot up alert.
stop system halt/reboot alert.
bootlogd print colorful boot record. *bootlogd required
Options:
-h, --help print this help.
Copyright (C) 2015 Jongmin Kim / [email protected]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.