rcK 753 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. export PATH=/bin:/sbin:/usr/bin:/usr/sbin
  3. busybox reboot -d 60 -f & # just in case…
  4. {
  5. [[ -f /proc/diag/led/power ]] && echo f >/proc/diag/led/power
  6. test -e /etc/rc.shutdown && (/bin/sh /etc/rc.shutdown) 2>&1
  7. grep '^#INIT ' /etc/init.d/* | \
  8. sort -rnk2 | \
  9. while read line; do
  10. shebang=$(sed -n '1s/^#![ ]*//p' ${line%%:*})
  11. case $shebang in
  12. *[\ \ ]*) shebang=\'$(echo X"$shebang" | sed \
  13. -e 's/^X//' -e "s/'/'\\\\''/g" \
  14. -e 's/^\([^ ][^ ]*\)[ ]*$/\1/' \
  15. -e 's/^\([^ ][^ ]*\)[ ][ ]*\(..*\)$/\1 \2/' \
  16. -e 's/^\([^ ][^ ]*\) /\1'\'' '\''/')\' ;;
  17. esac
  18. ${shebang:-/bin/sh} ${line%%:*} autostop 2>&1
  19. done
  20. [[ -f /proc/diag/led/power ]] && echo 0 >/proc/diag/led/power
  21. } | logger -s -p 6 -t ''