From b4444023a2f9620b3f7a2a7971f0a8d3fd5e54d7 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 25 Mar 2024 05:49:24 +0100 Subject: [PATCH] Wait after restarting FTL before trying to check version Signed-off-by: DL6ER --- advanced/Scripts/piholeCheckout.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 65e6ebb8..0514b8eb 100755 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -193,6 +193,19 @@ checkout() { FTLinstall "${binary}" restart_service pihole-FTL enable_service pihole-FTL + str="Restarting FTL..." + echo -ne " ${INFO} ${str}" + # Wait until name resolution is working again after restarting FTL, + # so that the updatechecker can run successfully and does not fail + # trying to resolve github.com + until getent hosts github.com &> /dev/null; do + # Append one dot for each second waiting + str="${str}." + echo -ne " ${OVER} ${INFO} ${str}" + sleep 1 + done + echo -e " ${OVER} ${TICK} Restarted FTL service" + # Update local and remote versions via updatechecker /opt/pihole/updatecheck.sh else