summaryrefslogtreecommitdiffstats
path: root/abs/core/runit/halt.script
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/runit/halt.script')
-rwxr-xr-xabs/core/runit/halt.script16
1 files changed, 16 insertions, 0 deletions
diff --git a/abs/core/runit/halt.script b/abs/core/runit/halt.script
new file mode 100755
index 0000000..b49ed7c
--- /dev/null
+++ b/abs/core/runit/halt.script
@@ -0,0 +1,16 @@
+#!/bin/bash
+. /etc/profile
+INIT=`ps -p 1 -o comm=`
+if [ x$1 = x-w ]
+then
+ /sbin/halt-init -w
+ exit 0
+fi
+chvt 1
+if [ x$INIT = xrunit ]
+then
+ /sbin/halt-runit $@
+else
+ /sbin/halt-init $@
+fi
+