Created
July 11, 2021 10:42
-
-
Save Aqua-4/23aba4653ef3498787bfc5dbe912a79a to your computer and use it in GitHub Desktop.
Script to reboot Raspberry pi when vnc server stops working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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