mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 11:19:59 +01:00
Use shell_exec() instead of exec() to obtain the full script output (and not only the last line!)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -20,20 +20,20 @@ if (!$api) {
|
||||
switch($type) {
|
||||
case "white":
|
||||
if(!isset($_POST["auditlog"]))
|
||||
echo exec("sudo pihole -w ${_POST['domain']}");
|
||||
echo shell_exec("sudo pihole -w ${_POST['domain']}");
|
||||
else
|
||||
{
|
||||
echo exec("sudo pihole -w -n ${_POST['domain']}");
|
||||
echo exec("sudo pihole -a audit ${_POST['domain']}");
|
||||
echo shell_exec("sudo pihole -w -n ${_POST['domain']}");
|
||||
echo shell_exec("sudo pihole -a audit ${_POST['domain']}");
|
||||
}
|
||||
break;
|
||||
case "black":
|
||||
if(!isset($_POST["auditlog"]))
|
||||
echo exec("sudo pihole -b ${_POST['domain']}");
|
||||
echo shell_exec("sudo pihole -b ${_POST['domain']}");
|
||||
else
|
||||
{
|
||||
echo exec("sudo pihole -b -n ${_POST['domain']}");
|
||||
echo exec("sudo pihole -a audit ${_POST['domain']}");
|
||||
echo shell_exec("sudo pihole -b -n ${_POST['domain']}");
|
||||
echo shell_exec("sudo pihole -a audit ${_POST['domain']}");
|
||||
}
|
||||
break;
|
||||
case "wild":
|
||||
|
||||
Reference in New Issue
Block a user