Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | # |
| 5 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | ### BEGIN INIT INFO |
| 7 | # Provides: halt |
| 8 | # Required-Start: |
| 9 | # Required-Stop: |
| 10 | # Default-Start: |
| 11 | # Default-Stop: 0 |
| 12 | # Short-Description: Execute the halt command. |
| 13 | # Description: |
| 14 | ### END INIT INFO |
| 15 | |
| 16 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 17 | |
| 18 | # See if we need to cut the power. |
| 19 | if test -x /etc/init.d/ups-monitor |
| 20 | then |
| 21 | /etc/init.d/ups-monitor poweroff |
| 22 | fi |
| 23 | |
| 24 | # Don't shut down drives if we're using RAID. |
| 25 | hddown="-h" |
| 26 | if grep -qs '^md.*active' /proc/mdstat |
| 27 | then |
| 28 | hddown="" |
| 29 | fi |
| 30 | |
| 31 | halt SED_HALTARGS -p $hddown |
| 32 | |
| 33 | : exit 0 |