summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@ScottUllrichImac.local>2010-05-18 17:27:15 -0400
committerScott Ullrich <sullrich@ScottUllrichImac.local>2010-05-18 17:27:15 -0400
commit15f1488904c0bd3a1b8d843f90b22587b5700936 (patch)
tree7fdd7b81f911269772c48f6a35ca8866a3f45d08
parent2e6a43a13c449ae0c486989cb60fd47e9fe541f1 (diff)
downloadpfsense-15f1488904c0bd3a1b8d843f90b22587b5700936.zip
pfsense-15f1488904c0bd3a1b8d843f90b22587b5700936.tar.gz
Add reset button support to alix/wrap. Obtained-from: m0n0wall
-rw-r--r--etc/inc/system.inc32
-rwxr-xr-xetc/rc.bootup5
2 files changed, 35 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index c3502c8..6ea3b9b 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -1339,4 +1339,34 @@ function enable_watchdog() {
exec("/usr/sbin/watchdogd");
}
}
-?>
+
+function system_check_reset_button() {
+ $specplatform = system_identify_specific_platform();
+
+ if ($specplatform['name'] != "wrap" && $specplatform['name'] != "alix")
+ return 0;
+
+ $retval = mwexec("/usr/local/sbin/" . $specplatform['name'] . "resetbtn");
+
+ if ($retval == 99) {
+ /* user has pressed reset button for 2 seconds -
+ reset to factory defaults */
+ echo <<<EOD
+
+***********************************************************************
+* Reset button pressed - resetting configuration to factory defaults. *
+* The system will reboot after this completes. *
+***********************************************************************
+
+
+EOD;
+
+ reset_factory_defaults();
+ system_reboot_sync();
+ exit(0);
+ }
+
+ return 0;
+}
+
+?> \ No newline at end of file
diff --git a/etc/rc.bootup b/etc/rc.bootup
index 8decbcd..91a51bd 100755
--- a/etc/rc.bootup
+++ b/etc/rc.bootup
@@ -365,6 +365,9 @@ upnp_start();
/* If powerd is enabled, lets launch it */
activate_powerd();
+/* check whether config reset is desired (via hardware button on WRAP/ALIX) */
+system_check_reset_button();
+
/* done */
unset($g['booting']);
@@ -372,4 +375,4 @@ led_normalize();
conf_mount_ro();
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud