#!/bin/bash # Modify it to your configuration DIR=/var/www/html/redmine/ # Start Redmine in daemon mode. start(){ cd $DIR ruby script/rails server webrick -e production -d > log/redmine.log } # Stop Redmine daemon stop(){ RUBYPID=`ps aux | grep "rails" | grep -v grep | awk '{print $2}'` if [ "x$RUBYPID" != "x" ]; then kill -2 $RUBYPID fi } # Check if Redmine is running status(){ RUBYPID=`ps aux | grep "rails" | grep -v grep | awk '{print $2}'` if [ "x$RUBYPID" = "x" ]; then echo "* Redmine is not running" else echo "* Redmine is running" fi
}
case "$1" in
start)
start
status
;;
stop)
stop
sleep 2
status
;;
status)
status
;;
restart|force-reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1
esac
沒有留言:
張貼留言