summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-12-28 20:52:33 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-12-28 20:52:33 +0000
commit405e5de066dd03d08d6ea51411d853cbdbfbce51 (patch)
tree658743a4d05825ccda2e96e9abaea7ae00bdf6ec
parent7ab8562cb3c392946b9911a009912e79d119dfa8 (diff)
downloadpfsense-405e5de066dd03d08d6ea51411d853cbdbfbce51.zip
pfsense-405e5de066dd03d08d6ea51411d853cbdbfbce51.tar.gz
Add rc.halt command which will shutdown and halt a running system.
Suggested-by: Bachman Kharazmi
-rw-r--r--etc/inc/system.inc8
-rwxr-xr-xetc/rc.halt6
-rwxr-xr-xetc/rc.reboot2
3 files changed, 15 insertions, 1 deletions
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
+
OpenPOWER on IntegriCloud