Last active
May 22, 2026 10:41
-
-
Save andrebrait/640323bce275223af5fd66040664f313 to your computer and use it in GitHub Desktop.
UOS Server Health Check - Restart upon failed startup
This file contains hidden or 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
| # Copy this file to /etc/systemd/system/ and run `systemctl enable uosserver-healthcheck` | |
| [Unit] | |
| Description=Unifi UOS Server Healthcheck | |
| After=uosserver.service | |
| [Service] | |
| Type=oneshot | |
| ExecStartPre=/bin/sleep 30s | |
| ExecStart=/bin/uosserver-healthcheck | |
| [Install] | |
| WantedBy=multi-user.target |
This file contains hidden or 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
| #!/bin/bash | |
| # Copy this file to /bin/uosserver-healthcheck | |
| UOS_URL="<insert_here_your-url" | |
| if curl -IksSL -o /dev/null "${UOS_URL}"; then | |
| echo "All good; continuing..." | |
| else | |
| echo "Restarting uosserver..." | |
| uosserver stop | |
| uosserver start | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment