mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Add a parameter to pidofFTL() function to allow a delay if necessary
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -693,8 +693,12 @@ function convertUnicodeToIDNA($unicode)
|
||||
}
|
||||
|
||||
// Return PID of FTL (used in settings.php)
|
||||
function pidofFTL()
|
||||
function pidofFTL($add_delay = false)
|
||||
{
|
||||
if ($add_delay) {
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
return shell_exec('pidof pihole-FTL');
|
||||
}
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ $DNSserverslist = readDNSserversList();
|
||||
|
||||
$error = '';
|
||||
$success = '';
|
||||
$FTLrestarted = false;
|
||||
|
||||
if (isset($_POST['field'])) {
|
||||
// Handle CSRF
|
||||
@@ -445,6 +446,7 @@ if (isset($_POST['field'])) {
|
||||
|
||||
case 'restartdns':
|
||||
pihole_execute('-a restartdns');
|
||||
$FTLrestarted = true;
|
||||
$success = 'The DNS server has been restarted';
|
||||
|
||||
break;
|
||||
@@ -554,6 +556,7 @@ if (isset($_POST['field'])) {
|
||||
|
||||
if ($privacylevel > $level) {
|
||||
pihole_execute('-a restartdns');
|
||||
$FTLrestarted = true;
|
||||
$success .= 'The privacy level has been decreased and the DNS resolver has been restarted';
|
||||
} elseif ($privacylevel < $level) {
|
||||
$success .= 'The privacy level has been increased';
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array('sysadmin', 'dns', 'piho
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<?php
|
||||
$FTLpid = intval(pidofFTL());
|
||||
$FTLpid = intval(pidofFTL($FTLrestarted));
|
||||
if ($FTLpid !== 0) {
|
||||
$FTLversion = exec('/usr/bin/pihole-FTL version'); ?>
|
||||
<table class="table table-striped table-bordered nowrap">
|
||||
|
||||
Reference in New Issue
Block a user