home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / kexec < prev    next >
Encoding:
Text File  |  2013-01-10  |  771 b   |  45 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:        kexec
  4. # Required-Start:    
  5. # Required-Stop:       reboot
  6. # X-Stop-After:        umountroot
  7. # Default-Start:
  8. # Default-Stop:
  9. # Short-Description: Execute the kexec -e command to reboot system
  10. # Description:
  11. ### END INIT INFO
  12.  
  13. PATH=/sbin:/bin
  14.  
  15. . /lib/lsb/init-functions
  16.  
  17. test -r /etc/default/kexec && . /etc/default/kexec
  18.  
  19. do_stop () {
  20.     test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
  21.     test -x /sbin/kexec || exit 0
  22.  
  23.     log_action_msg "Will now restart with kexec"
  24.         kexec -e
  25.         log_failure_msg "kexec failed"
  26. }
  27.  
  28. case "$1" in
  29.   start)
  30.     # No-op
  31.     ;;
  32.   restart|reload|force-reload)
  33.     echo "Error: argument '$1' not supported" >&2
  34.     exit 3
  35.     ;;
  36.   stop)
  37.     do_stop
  38.     ;;
  39.   *)
  40.     echo "Usage: $0 start|stop" >&2
  41.     exit 3
  42.     ;;
  43. esac
  44. exit 0
  45.