1234567891011121314151617181920 |
- #!/bin/sh
- #110505 support sudo for non-root user.
- #120408 support minit
- #140622 shinobar avoid freeze on a virtual terminal, skip shutdownconfig
- . /etc/rc.d/PUPSTATE
- [ "$PUPMODE" = "5" ] && [ $PPID -eq 1 ] && touch /tmp/shutdownconfig_results && sync #skip shutdownconfig
- [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
- [ "$DISPLAY" ] && which wmreboot &>/dev/null && exec wmreboot #avoid freeze on a virtual terminal
- /etc/rc.d/rc.shutdown
- REBOOTEXE='/bin/busybox reboot'
- #[ -f /sbin/minit ] && REBOOTEXE='/sbin/shutdown -r' #-r means reboot. note, shutdown is part of minit pkg.
- [ -f /sbin/minit ] && REBOOTEXE='hard-reboot RESTART' #note, hard-reboot is part of minit pkg.
- exec ${REBOOTEXE} #>/dev/null 2>&1
|