Skip to content

Instantly share code, notes, and snippets.

@dirkkelly
Created January 30, 2010 05:25
Show Gist options
  • Save dirkkelly/290429 to your computer and use it in GitHub Desktop.
Save dirkkelly/290429 to your computer and use it in GitHub Desktop.
export RAILS_ENV='development'
export GEM_HOME='/opt/gems'
export GEM_PATH='/opt/gems'
PATH='/opt/ruby/current/bin:/opt/gems:/opt/gems/bin:/opt/nginx/current/sbin:/opt/git/current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin'
function nginx_start() {
sudo /opt/nginx/sbin/nginx
}
function nginx_reload() {
FILE="/opt/nginx/logs/nginx.pid"
if [ -e $FILE ]; then
echo "Reloading NGINX..."
PID=`cat $FILE`
sudo kill -HUP $PID
else
echo "Nginx pid file not found"
return 0
fi
}
function nginx_stop() {
FILE="/opt/nginx/logs/nginx.pid"
if [ -e $FILE ]; then
echo "Stopping NGINX..."
PID=`cat $FILE`
sudo kill -INT $PID
else
echo "Nginx pid file not found"
return 0
fi
}
function nginx_restart() {
FILE="/opt/nginx/logs/nginx.pid"
if [ -e $FILE ]; then
echo "Stopping NGINX..."
PID=`cat $FILE`
sudo kill -INT $PID
sleep 1
echo "Starting NGINX..."
sudo nginx
else
echo "Nginx pid file not found"
return 0
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment