blob: ba967c7650f190bbd1e74bd5564e8b5be39f1bcb [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
Patrick Williams45852732022-04-02 08:58:32 -05002#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006### 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
16PATH=/sbin:/bin:/usr/sbin:/usr/bin
17
18# See if we need to cut the power.
19if test -x /etc/init.d/ups-monitor
20then
21 /etc/init.d/ups-monitor poweroff
22fi
23
24# Don't shut down drives if we're using RAID.
25hddown="-h"
26if grep -qs '^md.*active' /proc/mdstat
27then
28 hddown=""
29fi
30
31halt SED_HALTARGS -p $hddown
32
33: exit 0