Created
July 20, 2023 12:39
-
-
Save rafaelvieiras/af017cb39410bcd3afe7321bc167356e to your computer and use it in GitHub Desktop.
Reboot Unraid UI with error off timeout
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
| #!/usr/bin/env bash | |
| pkill -9 nginx | |
| pkillexitstatus=$? | |
| if [ $pkillexitstatus -eq 0 ]; then | |
| echo "pkill exited normally with nginx killed" | |
| elif [ $pkillexitstatus -eq 1]; then | |
| echo "could not find nginx process to kill" | |
| elif [ $pkillexitstatus -eq 2]; then | |
| echo "syntax error in trying to kill nginx using \'pkill -9 nginx\'" | |
| elif [ $pkillexitstatus -eq 3]; then | |
| echo "fatal error using \'pkill -9 nginx\'" | |
| else | |
| echo UNEXPECTED | |
| fi | |
| /etc/rc.d/rc.nginx start | |
| nginxstatus=$? | |
| if [ $nginxstatus -eq 0 ]; then | |
| echo "nginx restarted normally with exit code " $nginxstatus | |
| else | |
| echo "nginx restart returned an abnormal exit code: " $nginxstatus | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment