halt 510 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: halt
  4. # Required-Start:
  5. # Required-Stop:
  6. # Default-Start:
  7. # Default-Stop: 0
  8. # Short-Description: Execute the halt command.
  9. # Description:
  10. ### END INIT INFO
  11. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  12. # See if we need to cut the power.
  13. if test -x /etc/init.d/ups-monitor
  14. then
  15. /etc/init.d/ups-monitor poweroff
  16. fi
  17. # Don't shut down drives if we're using RAID.
  18. hddown="-h"
  19. if grep -qs '^md.*active' /proc/mdstat
  20. then
  21. hddown=""
  22. fi
  23. halt -d -f -p $hddown
  24. : exit 0