Dash:
[t2-trunk.git] / target / share / install / rootfs / sbin / shutdown
blob62245997b337178668cb72e7d37fb770b7b579c2
1 #!/bin/sh
3 echo "Sending all processes a SIGTERM (15)."
4 killall5 -15 || error=$? ; sleep 5
6 echo "Sending all processes a 2nd SIGTERM (15)."
7 killall5 -15 || error=$? ; sleep 5
9 echo "Sending all processes a SIGKILL (9)."
10 killall5 -9 || error=$? ; sleep 5
12 echo "Turning off swap devices."
13 swapoff -a || error=$?
14 sync ; sleep 1
16 echo "Unmounting filesystems."
17 umount -avf || error=$?
19 if [[ "$*" = *-h* ]]; then
20 echo "Powering off."
21 halt -pf
22 else
23 echo "Rebooting the system."
24 reboot -f