mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 12:15:00 +01:00
@@ -31,7 +31,7 @@ switch($type) {
|
||||
echo shell_exec("sudo pihole -w --web ".$domains);
|
||||
else
|
||||
{
|
||||
echo shell_exec("sudo pihole -w --web -n ".$domains);
|
||||
echo shell_exec("sudo pihole -w --web ".$domains);
|
||||
echo shell_exec("sudo pihole -a audit ".$domains);
|
||||
}
|
||||
break;
|
||||
@@ -40,7 +40,7 @@ switch($type) {
|
||||
echo shell_exec("sudo pihole -b --web ".$domains);
|
||||
else
|
||||
{
|
||||
echo shell_exec("sudo pihole -b --web -n ".$domains);
|
||||
echo shell_exec("sudo pihole -b --web ".$domains);
|
||||
echo shell_exec("sudo pihole -a audit ".$domains);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -24,38 +24,8 @@ else
|
||||
$GRAVITYDB = "/etc/pihole/gravity.db";
|
||||
}
|
||||
|
||||
function SQLite3_connect($dbfile, $trytoreconnect)
|
||||
{
|
||||
try
|
||||
{
|
||||
// connect to database
|
||||
return new SQLite3($dbfile, SQLITE3_OPEN_READONLY);
|
||||
}
|
||||
catch (Exception $exception)
|
||||
{
|
||||
// sqlite3 throws an exception when it is unable to connect, try to reconnect after 3 seconds
|
||||
if($trytoreconnect)
|
||||
{
|
||||
sleep(3);
|
||||
$db = SQLite3_connect($dbfile, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(strlen($GRAVITYDB) > 0)
|
||||
{
|
||||
$db = SQLite3_connect($GRAVITYDB, true);
|
||||
|
||||
// Check if we successfully opened the database
|
||||
if(!$db)
|
||||
{
|
||||
die("Error connecting to database");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
die("No database available");
|
||||
}
|
||||
require("database.php");
|
||||
$db = SQLite3_connect($GRAVITYDB);
|
||||
|
||||
function getTableContent($listname) {
|
||||
global $db;
|
||||
|
||||
Reference in New Issue
Block a user