mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Implement dnsmasq restart button
This commit is contained in:
@@ -37,6 +37,18 @@ function DisplayDHCPConfig()
|
|||||||
$status->addMessage('Failed to start dnsmasq', 'danger');
|
$status->addMessage('Failed to start dnsmasq', 'danger');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif (isset($_POST['restartdhcpd'])) {
|
||||||
|
if ($dnsmasq_state) {
|
||||||
|
exec('sudo /bin/systemctl restart dnsmasq.service', $dnsmasq, $return);
|
||||||
|
if ($return == 0) {
|
||||||
|
$status->addMessage('Successfully restarted dnsmasq', 'success');
|
||||||
|
$dnsmasq_state = false;
|
||||||
|
} else {
|
||||||
|
$status->addMessage('Failed to restart dnsmasq', 'danger');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$status->addMessage('dnsmasq already stopped', 'info');
|
||||||
|
}
|
||||||
} elseif (isset($_POST['stopdhcpd'])) {
|
} elseif (isset($_POST['stopdhcpd'])) {
|
||||||
if ($dnsmasq_state) {
|
if ($dnsmasq_state) {
|
||||||
exec('sudo /bin/systemctl stop dnsmasq.service', $dnsmasq, $return);
|
exec('sudo /bin/systemctl stop dnsmasq.service', $dnsmasq, $return);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
|
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
|
||||||
<?php if ($dnsmasq_state) : ?>
|
<?php if ($dnsmasq_state) : ?>
|
||||||
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop dnsmasq") ?>" name="stopdhcpd" />
|
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop dnsmasq") ?>" name="stopdhcpd" />
|
||||||
|
<input type="submit" class="btn btn-warning" value="<?php echo _("Restart dnsmasq") ?>" name="restartdhcpd" />
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<input type="submit" class="btn btn-success" value="<?php echo _("Start dnsmasq") ?>" name="startdhcpd" />
|
<input type="submit" class="btn btn-success" value="<?php echo _("Start dnsmasq") ?>" name="startdhcpd" />
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user