File fix_sudo_commands.patch of Package pihole-admin-lte
53
1
Index: AdminLTE-5.20.1/scripts/pi-hole/php/debug.php
2
===================================================================
3
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/debug.php
4
+++ AdminLTE-5.20.1/scripts/pi-hole/php/debug.php
5
6
}
7
8
// Execute "pihole" using Web option
9
-$command = 'export TERM=dumb && sudo pihole -d -w';
10
+$command = 'export TERM=dumb && pihole -d -w';
11
12
// Add auto-upload option
13
if (isset($_GET['upload'])) {
14
Index: AdminLTE-5.20.1/scripts/pi-hole/php/func.php
15
===================================================================
16
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/func.php
17
+++ AdminLTE-5.20.1/scripts/pi-hole/php/func.php
18
19
$escaped = escapeshellcmd($argument_string);
20
$output = null;
21
$return_status = -1;
22
- $command = 'sudo pihole '.$escaped;
23
+ $command = 'pihole '.$escaped;
24
exec($command, $output, $return_status);
25
if ($return_status !== 0) {
26
trigger_error("Executing {$command} failed.", E_USER_WARNING);
27
Index: AdminLTE-5.20.1/scripts/pi-hole/php/gravity.sh.php
28
===================================================================
29
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/gravity.sh.php
30
+++ AdminLTE-5.20.1/scripts/pi-hole/php/gravity.sh.php
31
32
echo 'data: '.implode("\ndata: ", explode("\n", $datatext))."\n\n";
33
}
34
35
-$proc = popen('sudo pihole -g', 'r');
36
+$proc = popen('pihole -g', 'r');
37
while (!feof($proc)) {
38
echoEvent(fread($proc, 4096));
39
}
40
Index: AdminLTE-5.20.1/scripts/pi-hole/php/queryads.php
41
===================================================================
42
--- AdminLTE-5.20.1.orig/scripts/pi-hole/php/queryads.php
43
+++ AdminLTE-5.20.1/scripts/pi-hole/php/queryads.php
44
45
$options .= ' -all';
46
}
47
48
-$proc = popen('sudo pihole -q '.$url.$options, 'r');
49
+$proc = popen('pihole -q '.$url.$options, 'r');
50
while (!feof($proc)) {
51
echoEvent(fread($proc, 4096), $url);
52
}
53