mirror of
https://github.com/pi-hole/web.git
synced 2026-04-26 19:55:15 +01:00
Fix multiple restarts while importing with Teleporter
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -220,7 +220,7 @@ function getCustomDNSEntries()
|
||||
return $entries;
|
||||
}
|
||||
|
||||
function addCustomDNSEntry($ip = '', $domain = '', $reload = '', $json = true)
|
||||
function addCustomDNSEntry($ip = '', $domain = '', $reload = '', $json = true, $teleporter = false)
|
||||
{
|
||||
try {
|
||||
if (isset($_REQUEST['ip'])) {
|
||||
@@ -279,7 +279,8 @@ function addCustomDNSEntry($ip = '', $domain = '', $reload = '', $json = true)
|
||||
foreach ($domains as $domain) {
|
||||
pihole_execute('-a addcustomdns '.$ip.' '.$domain.' '.$reload);
|
||||
}
|
||||
if ($num > 0) {
|
||||
// restart only if not called from teleporter.php as it handles restarts itself
|
||||
if (($num > 0) && (!$teleporter)) {
|
||||
pihole_execute('restartdns');
|
||||
}
|
||||
|
||||
@@ -397,7 +398,7 @@ function getCustomCNAMEEntries()
|
||||
return $entries;
|
||||
}
|
||||
|
||||
function addCustomCNAMEEntry($domain = '', $target = '', $reload = '', $json = true)
|
||||
function addCustomCNAMEEntry($domain = '', $target = '', $reload = '', $json = true, $teleporter = false)
|
||||
{
|
||||
try {
|
||||
if (isset($_REQUEST['domain'])) {
|
||||
@@ -460,7 +461,8 @@ function addCustomCNAMEEntry($domain = '', $target = '', $reload = '', $json = t
|
||||
pihole_execute('-a addcustomcname '.$d.' '.$target.' '.$reload);
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
// restart only if not called from teleporter.php as it handles restarts itself
|
||||
if (($num > 0) && (!$teleporter)) {
|
||||
pihole_execute('restartdns');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user