mirror of
https://github.com/unraid/webgui.git
synced 2026-03-01 13:49:18 -06:00
Added "safe mode" option selection
This commit is contained in:
@@ -546,7 +546,7 @@ function formatWarning(val) {
|
||||
<form name="shutdownOps" method="POST" action="/webGui/include/Boot.php">
|
||||
<table markdown="1" class="array_status noshift">
|
||||
<tr><td></td><td><input type="button" name="reboot" value="_(Reboot)_" onclick="shutdown_now(this.form,'reboot')"><input type="button" name="shutdown" value="_(Shutdown)_" onclick="shutdown_now(this.form,'shutdown')"></td>
|
||||
<td>**_(Reboot)_** _(will activate a *clean* system reset)_.<br>**_(Shutdown)_** _(will activate a *clean* system power down)_.</td></tr>
|
||||
<td>**_(Reboot)_** _(will activate a *clean* system reset)_.<br>**_(Shutdown)_** _(will activate a *clean* system power down)_.<br><input type="checkbox" name="safemode"><small>_(Reboot in safe mode)_</small></td></tr>
|
||||
<tr><td></td><td class="line" colspan="2"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -75,12 +75,15 @@ $(document).ajaxSend(function(elm, xhr, s){
|
||||
</script>
|
||||
</head>
|
||||
<?
|
||||
$safemode = '/boot/unraidsafemode';
|
||||
switch ($_POST['cmd']) {
|
||||
case 'reboot':
|
||||
if (isset($_POST['safemode'])) touch($safemode); else @unlink($safemode);
|
||||
exec('/sbin/reboot');?>
|
||||
<body onload="reboot_online()"><div class='notice'></div></body>
|
||||
<? break;
|
||||
case 'shutdown':
|
||||
if (isset($_POST['safemode'])) touch($safemode); else @unlink($safemode);
|
||||
exec('/sbin/poweroff');?>
|
||||
<body onload="shutdown_online()"><div class='notice'></div></body>
|
||||
<? break;
|
||||
|
||||
Reference in New Issue
Block a user