Skip to content

Instantly share code, notes, and snippets.

@rafaelvieiras
Created July 20, 2023 12:39
Show Gist options
  • Select an option

  • Save rafaelvieiras/af017cb39410bcd3afe7321bc167356e to your computer and use it in GitHub Desktop.

Select an option

Save rafaelvieiras/af017cb39410bcd3afe7321bc167356e to your computer and use it in GitHub Desktop.
Reboot Unraid UI with error off timeout
#!/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