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