https://github.com/jmkim/bootmail
Email you when the system goes on boot process, Init and shutdown
https://github.com/jmkim/bootmail
initscript mailer shell
Last synced: 6 months ago
JSON representation
Email you when the system goes on boot process, Init and shutdown
- Host: GitHub
- URL: https://github.com/jmkim/bootmail
- Owner: jmkim
- Created: 2014-06-22T05:53:11.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-02T06:36:57.000Z (over 10 years ago)
- Last Synced: 2025-03-21T08:14:47.065Z (11 months ago)
- Topics: initscript, mailer, shell
- Language: Shell
- Homepage:
- Size: 426 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```
bootmail: A Linux Bash script made for sending a mail about system boot.
```
## Requirements
```
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)
```
## Installation
#### Run [AutoInstaller](https://raw.githubusercontent.com/kdzlvaids/bootmail/master/install.sh)
```bash
$ wget https://raw.githubusercontent.com/kdzlvaids/bootmail/master/install.sh
$ chmod 755 install.sh
$ sudo ./install.sh
```
#### or more hard way
```bash
# Download script
$ git clone git@github.com: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
```
```bash
# 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
```
## Usage
```bash
# 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.
```
## License
```
Copyright (C) 2015 Jongmin Kim / kdzlvaids@gmail.com
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 .
```