From 0734a2406ccf9965fd2cd7eef619ea54b9e359b5 Mon Sep 17 00:00:00 2001 From: openoms Date: Sat, 23 Jul 2022 15:34:11 +0100 Subject: [PATCH] improve Tor update logic --- home.admin/config.scripts/tor.network.sh | 34 +++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/home.admin/config.scripts/tor.network.sh b/home.admin/config.scripts/tor.network.sh index 2f68fc834..76d8f6df2 100755 --- a/home.admin/config.scripts/tor.network.sh +++ b/home.admin/config.scripts/tor.network.sh @@ -197,22 +197,26 @@ EOF echo ;; - update) - /home/admin/config.scripts/tor.install.sh update - if sudo systemctl is-active lnd ;then - echo "# LND will be restarted" - sudo systemctl restart lnd - sudo systemctl restart tlnd 2>/dev/null - sudo systemctl restart slnd 2>/dev/null - sleep 10 - lncli unlock - fi - if sudo 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 + 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 + sudo systemctl restart slnd 2>/dev/null + sleep 10 + lncli unlock + fi + 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 ;;