fixup! fix warp update

This commit is contained in:
mercury
2024-10-27 01:32:13 +04:00
parent 32109c4526
commit a0d9bada2b
+5 -7
View File
@@ -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;
}