#!/bin/bash # # sendmail This shell script takes care of starting and stopping # sendmail. # # chkconfig: 2345 80 30 # description: Sendmail is a Mail Transport Agent, which is the program \ # that moves mail from one machine to another. # processname: sendmail # config: /etc/mail/sendmail.cf # pidfile: /var/run/sendmail.pid # Source function library. . /etc/rc.d/init.d/functions # Get config. . /etc/sysconfig/network # Check that networking is up. if [ ${NETWORKING} = "no" ] then exit 0 fi prog_name=********** exec_file="/usr/sbin/**********" lock_file="/var/lock/**********" pid_file="/var/run/**********.pid" RETVAL=0 start() { echo -n $"Starting $prog_name: " daemon $exec_file -bd -q15m RETVAL=$? echo [ $RETVAL = 0 ] && touch $lock_file return $RETVAL } restart() { echo -n $"reloading $prog_name: " daemon $prog killproc $prog -HUP RETVAL=$? return $RETVAL } stop() { echo -n $"Stopping $prog_name: " killproc $exec_file RETVAL=$? echo [ $RETVAL = 0 ] && rm -f $lock_file $pid_file } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) $exec_file status ;; *) echo $"Usage: $prog_name {start|stop|restart|status}" exit 1 esac exit $RETVAL