Skip to content

Instantly share code, notes, and snippets.

@hangj
Last active September 16, 2019 07:13
Show Gist options
  • Save hangj/bad667f05069c1c6fec17e524fc0cd8a to your computer and use it in GitHub Desktop.
Save hangj/bad667f05069c1c6fec17e524fc0cd8a to your computer and use it in GitHub Desktop.
run/reload openresty
#!/usr/bin/bash
cd ~/work/ || exit
sudo openresty -p `pwd` -c conf/nginx.conf -t || exit
ps -ef | grep openresty | grep -v grep
if [ $? -eq 0 ]
then
sudo openresty -p `pwd` -c conf/nginx.conf -s reload
else
sudo openresty -p `pwd` -c conf/nginx.conf
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment