mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
Be able to pass delay for automatic reactivation to API
This commit is contained in:
11
api.php
11
api.php
@@ -70,7 +70,16 @@
|
||||
}
|
||||
elseif (isset($_GET['disable'], $_GET['token']) && $auth) {
|
||||
check_csrf($_GET['token']);
|
||||
exec('sudo pihole disable');
|
||||
$disable = intval($_GET['disable']);
|
||||
// intval returns the integer value on success, or 0 on failure
|
||||
if($disable > 0)
|
||||
{
|
||||
exec("sudo pihole disable ".$disable."s");
|
||||
}
|
||||
else
|
||||
{
|
||||
exec('sudo pihole disable');
|
||||
}
|
||||
$data = array_merge($data, Array(
|
||||
"status" => "disabled"
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user