slitaz-arm annotate rootfs/etc/init.d/shutdown.sh @ rev 219
dot command may not search current directory first
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 23 13:50:45 2017 +0200 (2017-07-23) |
parents | 524fe16cd714 |
children |
rev | line source |
---|---|
pankso@13 | 1 #!/bin/sh |
pankso@13 | 2 # |
pankso@13 | 3 # /etc/init.d/shutdown.sh: System shutdown or reboot script |
pankso@13 | 4 # |
pankso@110 | 5 # Copyright (C) 2012-2014 SliTaz ARM - BSD License |
pankso@13 | 6 # |
pankso@13 | 7 . /lib/libtaz.sh |
pankso@13 | 8 . /etc/rcS.conf |
pankso@13 | 9 |
pankso@13 | 10 # Messages |
pankso@98 | 11 clear |
pankso@13 | 12 boldify "System is going down for reboot or halt..." |
pankso@98 | 13 newline |
pankso@13 | 14 colorize 32 $(uptime) |
pankso@80 | 15 newline |
pankso@13 | 16 |
pankso@13 | 17 # Stop all daemons started at boot time |
pankso@13 | 18 if [ "$RUN_DAEMONS" ]; then |
paul@29 | 19 colorize 33 "Stopping all daemons..." |
pankso@13 | 20 for daemon in $RUN_DAEMONS; do |
pankso@13 | 21 /etc/init.d/$daemon stop |
pankso@13 | 22 done |
pankso@13 | 23 fi |
pankso@13 | 24 |
pankso@13 | 25 # Sync all filesystems |
pankso@13 | 26 sync |
pankso@13 | 27 |
pankso@13 | 28 # Swap off |
pankso@13 | 29 /sbin/swapoff -a |
pankso@13 | 30 |
pankso@13 | 31 # Kill all processes |
pankso@13 | 32 killall5 |
pankso@13 | 33 |
pankso@13 | 34 # Umount filesystems |
pankso@13 | 35 /bin/umount -a -r 2>/dev/null |