Home | History | Annotate | Line # | Download | only in etc
rc.shutdown revision 1.1
      1  1.1  bad #	$NetBSD: rc.shutdown,v 1.1 1998/10/29 20:24:57 bad Exp $
      2  1.1  bad 
      3  1.1  bad # System shutdown script run by shutdown before halting/rebooting
      4  1.1  bad # or going single-user.
      5  1.1  bad 
      6  1.1  bad stty status '^T'
      7  1.1  bad 
      8  1.1  bad export HOME=/
      9  1.1  bad export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
     10  1.1  bad 
     11  1.1  bad if [ -f /etc/rc.subr ]; then
     12  1.1  bad 	. /etc/rc.subr
     13  1.1  bad else
     14  1.1  bad 	echo "Can't read /etc/rc.subr; aborting."
     15  1.1  bad 	exit 1;
     16  1.1  bad fi
     17  1.1  bad 
     18  1.1  bad if [ -f /etc/rc.conf ]; then
     19  1.1  bad 	. /etc/rc.conf
     20  1.1  bad fi
     21  1.1  bad 
     22  1.1  bad if checkyesno do_rcshutdown; then
     23  1.1  bad 	: # Everything's hunkdory
     24  1.1  bad else
     25  1.1  bad 	echo "Skipping shutdown hooks."
     26  1.1  bad 	exit 0
     27  1.1  bad fi
     28  1.1  bad 
     29  1.1  bad if [ -f /etc/rc.shutdown.local ]; then
     30  1.1  bad 	. /etc/rc.shutdown.local
     31  1.1  bad fi
     32  1.1  bad 
     33  1.1  bad # Kill xdm and wait for it to terminate.
     34  1.1  bad if checkyesno xdm; then
     35  1.1  bad 	XDM_PID=`sed 1q /var/run/xdm-pid`
     36  1.1  bad 	if [ -n "$XDM_PID" ]; then
     37  1.1  bad 		echo -n ' xdm'
     38  1.1  bad 		kill $XDM_PID
     39  1.1  bad 		while kill -0 $XDM_PID; do
     40  1.1  bad 			sleep 1
     41  1.1  bad 		done
     42  1.1  bad 	fi
     43  1.1  bad fi
     44  1.1  bad 
     45  1.1  bad exit 0
     46