Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 | |
| 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 13 | |
| 14 | # See if we need to cut the power. |
| 15 | if test -x /etc/init.d/ups-monitor |
| 16 | then |
| 17 | /etc/init.d/ups-monitor poweroff |
| 18 | fi |
| 19 | |
| 20 | # Don't shut down drives if we're using RAID. |
| 21 | hddown="-h" |
| 22 | if grep -qs '^md.*active' /proc/mdstat |
| 23 | then |
| 24 | hddown="" |
| 25 | fi |
| 26 | |
| 27 | halt SED_HALTARGS -p $hddown |
| 28 | |
| 29 | : exit 0 |