mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-14 13:02:58 +02:00
43 lines
819 B
Bash
43 lines
819 B
Bash
#!/bin/sh
|
|
########################################################################
|
|
# Begin $rc_base/init.d/halt
|
|
#
|
|
# Description : Halt Script
|
|
#
|
|
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
|
|
#
|
|
# Version : 00.00
|
|
#
|
|
# Notes :
|
|
#
|
|
########################################################################
|
|
|
|
. /etc/sysconfig/rc
|
|
. ${rc_functions}
|
|
|
|
case "${1}" in
|
|
stop)
|
|
sync && sync
|
|
boot_mesg "Remount root readonly..."
|
|
mount -f -o remount,ro / > /dev/null 2>&1
|
|
evaluate_retval
|
|
|
|
boot_mesg "Prepare for halt..."
|
|
sleep 2
|
|
|
|
#Disable all leds at shutdown
|
|
for led in $(ls /sys/class/leds); do
|
|
echo "none" > /sys/class/leds/$led/trigger
|
|
echo "0" > /sys/class/leds/$led/brightness
|
|
done
|
|
|
|
halt -d -f -i -p
|
|
;;
|
|
*)
|
|
echo "Usage: {stop}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# End $rc_base/init.d/halt
|