Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait after restarting FTL before trying to check version #5613

Open
wants to merge 1 commit into
base: development-v6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion advanced/Scripts/piholeCheckout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,23 @@ checkout() {
echo " ${TICK} Branch ${2} exists"
echo "${2}" > /etc/pihole/ftlbranch
chmod 644 /etc/pihole/ftlbranch
echo -e " ${INFO} Switching to branch: \"${2}\" from \"${oldbranch}\""
echo -e " ${INFO} Switching to branch \"${2}\" from \"${oldbranch}\""
FTLinstall "${binary}"
restart_service pihole-FTL
enable_service pihole-FTL
str="Restarting FTL..."
echo -ne " ${INFO} ${str}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the timeout could be 60 seconds but my opinion is that waiting "forever" and constantly showing that the script is still alive is the proper way to do this

Should we add here a text explaining FTL can take some time to restart and the process can loop forever without a connection? ("this can take several seconds")

Should we add "Press CTRL+C to exit"?
Or something like a simplified version of this spinner?

# 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
rdwebdesign marked this conversation as resolved.
Show resolved Hide resolved
# 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
Expand Down