diff --git a/app/bot.php b/app/bot.php
index 722e335..66b8d33 100644
--- a/app/bot.php
+++ b/app/bot.php
@@ -3872,11 +3872,10 @@ DNS-over-HTTPS with IP:
public function xray($page = 0)
{
- if (!$this->ssh('pgrep sing-box', 'si')) {
+ $pac = $this->getPacConf();
+ if (!$this->ssh('pgrep sing-box', 'si') || empty($pac['xray']['private'])) {
$this->generateSecretXray();
}
- $c = $this->getXray();
- $pac = $this->getPacConf();
$text[] = "Menu -> " . $this->i18n('xray');
$text[] = "\nfake domain: {$pac['xray']['domain']}";
$text[] = "public: {$pac['xray']['public']}";