File fix_sudo_commands.patch of Package pihole-admin-lte
Index: AdminLTE-5.20.1/scripts/pi-hole/php/debug.php
===================================================================
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/debug.php
+++ AdminLTE-5.20.1/scripts/pi-hole/php/debug.php
@@ -52,7 +52,7 @@ function echoEvent($datatext)
}
// Execute "pihole" using Web option
-$command = 'export TERM=dumb && sudo pihole -d -w';
+$command = 'export TERM=dumb && pihole -d -w';
// Add auto-upload option
if (isset($_GET['upload'])) {
Index: AdminLTE-5.20.1/scripts/pi-hole/php/func.php
===================================================================
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/func.php
+++ AdminLTE-5.20.1/scripts/pi-hole/php/func.php
@@ -166,7 +166,7 @@ function pihole_execute($argument_string
$escaped = escapeshellcmd($argument_string);
$output = null;
$return_status = -1;
- $command = 'sudo pihole '.$escaped;
+ $command = 'pihole '.$escaped;
exec($command, $output, $return_status);
if ($return_status !== 0) {
trigger_error("Executing {$command} failed.", E_USER_WARNING);
Index: AdminLTE-5.20.1/scripts/pi-hole/php/gravity.sh.php
===================================================================
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/gravity.sh.php
+++ AdminLTE-5.20.1/scripts/pi-hole/php/gravity.sh.php
@@ -41,7 +41,7 @@ function echoEvent($datatext)
echo 'data: '.implode("\ndata: ", explode("\n", $datatext))."\n\n";
}
-$proc = popen('sudo pihole -g', 'r');
+$proc = popen('pihole -g', 'r');
while (!feof($proc)) {
echoEvent(fread($proc, 4096));
}
Index: AdminLTE-5.20.1/scripts/pi-hole/php/queryads.php
===================================================================
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/queryads.php
+++ AdminLTE-5.20.1/scripts/pi-hole/php/queryads.php
@@ -61,7 +61,7 @@ if (isset($_GET['showall'])) {
$options .= ' -all';
}
-$proc = popen('sudo pihole -q '.$url.$options, 'r');
+$proc = popen('pihole -q '.$url.$options, 'r');
while (!feof($proc)) {
echoEvent(fread($proc, 4096), $url);
}