#! /bin/sh # /etc/rc.d/rc.shutdown # # local system shutdown script. # # Put any local shutdown commands in here. # # modified for colorized screen messages and local needs source /etc/functions-colors stop_process () { PROCESS_PID=`/sbin/pidof $1` if [ -n "$2" ] ; then SCRIPT=$2 else SCRIPT=$1 fi if [ "$PROCESS_PID" != "" ]; then if [ -f /etc/rc.d/rc.$SCRIPT ] ; then if [ -x /etc/rc.d/rc.$SCRIPT ] ; then echo -e "${BOLDWHITE}Attempting to shut down the ${BOLDGREEN}$SCRIPT${BOLDWHITE} service.${COLOR_RESET}" /etc/rc.d/rc.$SCRIPT stop fi else echo -e "${BOLDRED}Oops. The ${BOLDGREEN}/etc/rc.d/rc.$1${BOLDRED} file does not exist!${COLOR_RESET}" fi fi } # Tell the viewers what's going to happen. echo -e "${BOLDBLUE}Running local shutdown tasks:${COLOR_RESET}" # stop the samba service: stop_process smbd samba # unmount remote (NFS) filesystems: # stop the port mapper service: # stop the NIS (the Network Information Service): # stop the vsftp daemon: stop_process vsftpd # stop the squid caching proxy server: stop_process squid # stop the ntpd network time protocol daemon: stop_process ntpd # stop the dnsmasq DNS/DHCP server: stop_process dnsmasq # stop the BIND name server daemon: # stop_process bind # Turn off IPv4 packet forwarding support: /bin/sh /etc/rc.d/rc.ip_forward stop # stop the inetd server: stop_process inetd # stop the OpenSSH SSH daemon: stop_process sshd # stop the apm daemon: stop_process apmd