Revision 15f14889
Added by Scott Ullrich about 15 years ago
etc/inc/system.inc | ||
---|---|---|
1339 | 1339 |
exec("/usr/sbin/watchdogd"); |
1340 | 1340 |
} |
1341 | 1341 |
} |
1342 |
?> |
|
1342 |
|
|
1343 |
function system_check_reset_button() { |
|
1344 |
$specplatform = system_identify_specific_platform(); |
|
1345 |
|
|
1346 |
if ($specplatform['name'] != "wrap" && $specplatform['name'] != "alix") |
|
1347 |
return 0; |
|
1348 |
|
|
1349 |
$retval = mwexec("/usr/local/sbin/" . $specplatform['name'] . "resetbtn"); |
|
1350 |
|
|
1351 |
if ($retval == 99) { |
|
1352 |
/* user has pressed reset button for 2 seconds - |
|
1353 |
reset to factory defaults */ |
|
1354 |
echo <<<EOD |
|
1355 |
|
|
1356 |
*********************************************************************** |
|
1357 |
* Reset button pressed - resetting configuration to factory defaults. * |
|
1358 |
* The system will reboot after this completes. * |
|
1359 |
*********************************************************************** |
|
1360 |
|
|
1361 |
|
|
1362 |
EOD; |
|
1363 |
|
|
1364 |
reset_factory_defaults(); |
|
1365 |
system_reboot_sync(); |
|
1366 |
exit(0); |
|
1367 |
} |
|
1368 |
|
|
1369 |
return 0; |
|
1370 |
} |
|
1371 |
|
|
1372 |
?> |
etc/rc.bootup | ||
---|---|---|
365 | 365 |
/* If powerd is enabled, lets launch it */ |
366 | 366 |
activate_powerd(); |
367 | 367 |
|
368 |
/* check whether config reset is desired (via hardware button on WRAP/ALIX) */ |
|
369 |
system_check_reset_button(); |
|
370 |
|
|
368 | 371 |
/* done */ |
369 | 372 |
unset($g['booting']); |
370 | 373 |
|
... | ... | |
372 | 375 |
|
373 | 376 |
conf_mount_ro(); |
374 | 377 |
|
375 |
?> |
|
378 |
?> |
Also available in: Unified diff
Add reset button support to alix/wrap. Obtained-from: m0n0wall