Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active November 10, 2016 23:25
Show Gist options
  • Save magnetikonline/11017919 to your computer and use it in GitHub Desktop.
Save magnetikonline/11017919 to your computer and use it in GitHub Desktop.
Nginx test/reload config bash scripts.
#!/bin/bash -e
PID="/run/nginx.pid"
if [[ ! -f $PID ]]; then
echo "Error: Nginx not currently running" >&2
exit 1
fi
kill -HUP $(cat $PID)
#!/bin/bash -e
/usr/local/nginx/sbin/nginx -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment