improve Tor update logic

This commit is contained in:
openoms
2022-07-23 15:34:11 +01:00
parent 237721c9f4
commit 2938ced67e

View File

@@ -197,22 +197,26 @@ EOF
echo echo
;; ;;
update) update)
/home/admin/config.scripts/tor.install.sh update if /home/admin/config.scripts/tor.install.sh update; then
if sudo systemctl is-active lnd ;then echo "# Tor was updated to $(tor --version)"
echo "# LND will be restarted" if systemctl is-active lnd ;then
sudo systemctl restart lnd echo "# LND will be restarted"
sudo systemctl restart tlnd 2>/dev/null sudo systemctl restart lnd
sudo systemctl restart slnd 2>/dev/null sudo systemctl restart tlnd 2>/dev/null
sleep 10 sudo systemctl restart slnd 2>/dev/null
lncli unlock sleep 10
fi lncli unlock
if sudo systemctl is-active lightningd; then fi
echo "# CLN will be restarted" if systemctl is-active lightningd; then
sudo systemctl restart lightningd echo "# CLN will be restarted"
sudo systemctl restart tlightningd 2>/dev/null sudo systemctl restart lightningd
sudo systemctl restart slightningd 2>/dev/null sudo systemctl restart tlightningd 2>/dev/null
sudo systemctl restart slightningd 2>/dev/null
fi
else
echo "# Tor was not updated"
tor --version
fi fi
;; ;;