Skip to content

Instantly share code, notes, and snippets.

@Aqua-4
Created July 11, 2021 10:42
Show Gist options
  • Save Aqua-4/23aba4653ef3498787bfc5dbe912a79a to your computer and use it in GitHub Desktop.
Save Aqua-4/23aba4653ef3498787bfc5dbe912a79a to your computer and use it in GitHub Desktop.
Script to reboot Raspberry pi when vnc server stops working
TIMED_OUT="HostedRendezvous: Rendezvous lookup failed: Hosted Bootstrap error: Network failure: Timed out fetching resource"
# sample response variable
# RESP="Jun 23 17:49:07 pi-desktop vncserver-x11[915]: HostedRendezvous: Rendezvous lookup failed: Hosted Bootstrap error: Network failure: Timed out fetching resource"
RESP=$(service vncserver-x11-serviced status)
if [[ "$RESP" =~ "$TIMED_OUT" ]]; then
echo "Network Failure, commencing reboot"
$(reboot)
else
echo "VNC Server is running"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment