diff --git a/app/bot.php b/app/bot.php index 1404208..ad3297f 100644 --- a/app/bot.php +++ b/app/bot.php @@ -637,6 +637,7 @@ class Bot $out[] = 'update pac'; $this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out)); $this->setPacConf($json['pac']); + $this->pacUpdate('1'); } // ad if (!empty($json['ad'])) { @@ -2130,9 +2131,9 @@ DNS-over-HTTPS with IP: $this->menu('pac'); } - public function pacUpdate() + public function pacUpdate($import = '') { - exec("php updatepac.php start {$this->input['chat']} {$this->input['message_id']} {$this->input['callback_id']} > /dev/null &"); + exec("php updatepac.php start {$this->input['chat']} {$this->input['message_id']} {$this->input['callback_id']} $import > /dev/null &"); } public function getSSConfig() diff --git a/app/updatepac.php b/app/updatepac.php index 5792823..5410bbf 100644 --- a/app/updatepac.php +++ b/app/updatepac.php @@ -269,9 +269,11 @@ function start() function endScript($text) { global $bot; - update($text); - sleep(2); - $bot->menu('pac'); + if (empty($_SERVER['argv'][5])) { + update($text); + sleep(2); + $bot->menu('pac'); + } die(); }