diff --git a/app/bot.php b/app/bot.php index 12adc32..b733781 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4693,8 +4693,10 @@ DNS-over-HTTPS with IP: public function offWarp() { $p = $this->getPacConf(); - $flag = $this->selfupdate ? empty($p['warpoff']) : !empty($p['warpoff']); - if ($flag) { + if (!empty($this->selfupdate) && !empty($p['warpoff'])) { + $this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp'); + $this->ssh('pkill warp-svc', 'wp'); + } elseif (!empty($p['warpoff'])) { $this->ssh('warp-svc > /dev/null 2>&1 &', 'wp'); sleep(3); if (empty($this->ssh('[ -f "/var/lib/cloudflare-warp/conf.json" ] && echo 1', 'wp'))) { @@ -4707,11 +4709,7 @@ DNS-over-HTTPS with IP: $this->send($this->input['chat'], 'Connect: ' . $this->ssh('warp-cli --accept-tos connect 2>&1', 'wp')); unset($p['warpoff']); } else { - if (!empty($this->selfupdate)) { - $this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp'); - } else { - $this->send($this->input['chat'], 'Registration delete: ' . $this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp')); - } + $this->send($this->input['chat'], 'Registration delete: ' . $this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp')); $this->ssh('pkill warp-svc', 'wp'); $p['warpoff'] = 1; }