]> TLD Linux GIT Repositories - rc-scripts.git/blob - rc.d/init.d/killall
- from PLD
[rc-scripts.git] / rc.d / init.d / killall
1 #!/bin/sh
2 #
3 # killall       Script for system downing
4 #
5 # description:  kill em all
6 #
7
8 # Bring down all services that are still running (there shouldn't be any, so
9 # this is just a sanity check)
10
11 # First set up a default search path.
12 export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
13
14 case "$1" in
15   start*)
16         exit 0
17         ;;
18   stop*)
19         for i in /var/lock/subsys/*; do
20                 # Check if the script is there.
21                 [ ! -f $i ] && continue
22
23                 # Get the subsystem name.
24                 subsys=${i#/var/lock/subsys/}
25
26                 # Bring the subsystem down.
27                 if [ -x /etc/rc.d/init.d/$subsys ]; then
28                         /etc/rc.d/init.d/$subsys stop
29                 elif [ -x /etc/rc.d/init.d/$subsys.init ]; then
30                         /etc/rc.d/init.d/$subsys.init stop
31                 fi
32         done
33         ;;
34 esac
35
36 exit 0