From 16bb1dce51851d71fc173ce662443b10222438d3 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sun, 16 Feb 2014 18:09:25 -0600
Subject: poweroff-scripts: update binary path to /usr/bin refs #961

---
 abs/core/poweroff-scripts/halt.script              | 19 +++++++++++--------
 abs/core/poweroff-scripts/poweroff-scripts.install |  8 +++++---
 abs/core/poweroff-scripts/poweroff.script          |  7 +++++--
 abs/core/poweroff-scripts/reboot.script            |  6 ++++--
 4 files changed, 25 insertions(+), 15 deletions(-)
 mode change 100644 => 100755 abs/core/poweroff-scripts/halt.script
 mode change 100644 => 100755 abs/core/poweroff-scripts/reboot.script

diff --git a/abs/core/poweroff-scripts/halt.script b/abs/core/poweroff-scripts/halt.script
old mode 100644
new mode 100755
index dacf16a..51c9925
--- a/abs/core/poweroff-scripts/halt.script
+++ b/abs/core/poweroff-scripts/halt.script
@@ -2,16 +2,19 @@
 MYTH_RUN_STATUS="1"
 . /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$1 = x-w ]
+# then
+# 	/sbin/halt.init -w
+# 	exit 0
+# fi
+
 if [ x$INIT = xrunit ]
 then
- 	 /sbin/halt-runit $@
+    echo "System whill shutdown NOW" |wall
+    chvt 1
+    runit-init 0
+
 else
-     	/sbin/halt.init $@
+    systemctrl $@
 fi
 
diff --git a/abs/core/poweroff-scripts/poweroff-scripts.install b/abs/core/poweroff-scripts/poweroff-scripts.install
index b066f1d..00b4a84 100644
--- a/abs/core/poweroff-scripts/poweroff-scripts.install
+++ b/abs/core/poweroff-scripts/poweroff-scripts.install
@@ -10,9 +10,11 @@ pre_upgrade () {
 }
 
 post_install () {
-
-	[ -e /sbin/halt.init ] || ln -sf /sbin/halt.init /sbin/reboot.init
-	[ -e /sbin/halt.init ] || ln -sf /sbin/halt.init /sbin/poweroff.init 
+    rm -f /sbin/reboot.init
+    rm -f /sbin/poweroff.init
+    
+	[ -e /usr/sbin/halt.init ] || ln -sf /usr/sbin/halt.init /usr/sbin/reboot.init
+	[ -e /usr/sbin/halt.init ] || ln -sf /usr/sbin/halt.init /usr/sbin/poweroff.init 
 }
 
 # arg 1:  the new package version
diff --git a/abs/core/poweroff-scripts/poweroff.script b/abs/core/poweroff-scripts/poweroff.script
index 99779eb..211c9ee 100644
--- a/abs/core/poweroff-scripts/poweroff.script
+++ b/abs/core/poweroff-scripts/poweroff.script
@@ -1,11 +1,14 @@
 #!/bin/bash
+MYTH_RUN_STATUS="1"
 . /etc/profile
 INIT=`ps -p 1 -o comm=`
 chvt 1
 if [ x$INIT = xrunit ]
 then
- 	 /sbin/halt-runit $@
+    echo "System whill shutdown NOW" |wall
+    chvt 1
+    runit-init 0
 else
-     	/sbin/poweroff.init $@
+    systemctl poweroff $@
 fi
 
diff --git a/abs/core/poweroff-scripts/reboot.script b/abs/core/poweroff-scripts/reboot.script
old mode 100644
new mode 100755
index 47ad99e..de2651c
--- a/abs/core/poweroff-scripts/reboot.script
+++ b/abs/core/poweroff-scripts/reboot.script
@@ -5,8 +5,10 @@ INIT=`ps -p 1 -o comm=`
 chvt 1
 if [ x$INIT = xrunit ]
 then
- 	 /sbin/reboot-runit $@
+    echo "System will reboot NOW" |wall
+    chvt 1
+    runit-init 6
 else
-     	/sbin/reboot.init $@
+    systemctl reboot $@
 fi
 
-- 
cgit v0.12

