Giter Site home page Giter Site logo

bootmail's Introduction

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

$ wget https://raw.githubusercontent.com/kdzlvaids/bootmail/master/install.sh
$ chmod 755 install.sh
$ sudo ./install.sh

or more hard way

# 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

Usage

# 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 / [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/>.

bootmail's People

Contributors

jmkim avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.