From 405e5de066dd03d08d6ea51411d853cbdbfbce51 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 28 Dec 2004 20:52:33 +0000 Subject: Add rc.halt command which will shutdown and halt a running system. Suggested-by: Bachman Kharazmi --- etc/inc/system.inc | 8 ++++++++ etc/rc.halt | 6 ++++++ etc/rc.reboot | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 etc/rc.halt diff --git a/etc/inc/system.inc b/etc/inc/system.inc index afd25c6..c6f2fee 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -448,6 +448,14 @@ function system_ntp_configure() { echo "done\n"; } +function system_halt() { + global $g; + + system_reboot_cleanup(); + + mwexec("nohup /etc/rc.halt > /dev/null 2>&1 &"); +} + function system_reboot() { global $g; diff --git a/etc/rc.halt b/etc/rc.halt new file mode 100755 index 0000000..40d6504 --- /dev/null +++ b/etc/rc.halt @@ -0,0 +1,6 @@ +#!/bin/sh + +sleep 1 + +/sbin/shutdown -h now + diff --git a/etc/rc.reboot b/etc/rc.reboot index e3bc88c..3216c61 100755 --- a/etc/rc.reboot +++ b/etc/rc.reboot @@ -3,4 +3,4 @@ sleep 1 /sbin/shutdown -r now -#/sbin/reboot + -- cgit v1.1