summaryrefslogtreecommitdiffstats
path: root/abs/core/poweroff-scripts/halt.script
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/poweroff-scripts/halt.script')
-rw-r--r--abs/core/poweroff-scripts/halt.script16
1 files changed, 16 insertions, 0 deletions
diff --git a/abs/core/poweroff-scripts/halt.script b/abs/core/poweroff-scripts/halt.script
new file mode 100644
index 0000000..cfc05aa
--- /dev/null
+++ b/abs/core/poweroff-scripts/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
+