diff --git a/app/bot.php b/app/bot.php
index 1c85b6a..6eb48c9 100644
--- a/app/bot.php
+++ b/app/bot.php
@@ -292,7 +292,7 @@ class Bot
public function generateSecret()
{
- $this->send($this->input['chat'], trim($this->ssh('head -c 16 /dev/urandom | xxd -ps', 'tg')));
+ $this->secretSet(trim($this->ssh('head -c 16 /dev/urandom | xxd -ps', 'tg')));
}
public function setSecret()
diff --git a/scripts/start_tg.sh b/scripts/start_tg.sh
index aed19f4..18febc3 100644
--- a/scripts/start_tg.sh
+++ b/scripts/start_tg.sh
@@ -4,9 +4,10 @@ echo 'PubkeyAcceptedKeyTypes +ssh-rsa' >> /etc/ssh/sshd_config
service ssh start
curl -s https://core.telegram.org/getProxySecret -o proxy-secret
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
-if [ $(cat /mtprotosecret | wc -c) -gt 0 ]
+if [ $(cat /mtprotosecret | wc -c) -eq 0 ]
then
- SECRET=$(cat /mtprotosecret)
- mtproto-proxy -u nobody -H $TGPORT --nat-info 10.10.0.8:$IP -S $SECRET --aes-pwd /proxy-secret /proxy-multi.conf -M 1
+ head -c 16 /dev/urandom | xxd -ps > /mtprotosecret
fi
+SECRET=$(cat /mtprotosecret)
+mtproto-proxy -u nobody -H $TGPORT --nat-info 10.10.0.8:$IP -S $SECRET --aes-pwd /proxy-secret /proxy-multi.conf -M 1
tail -f /dev/null
diff --git a/version b/version
index 531721d..62e4a2d 100644
--- a/version
+++ b/version
@@ -1,3 +1,5 @@
+06.06.2023 изменена логика запуска MTProto и кнопки генерации секрета
+git pull
06.06.2023 фикс зависания wireguard после ребута
git pull
в файле
config/wg0.confудалите строчку с DNS, если она там есть