Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shell script for Jekyll to loaded on server load.
#!/bin/sh
# jekyll Starts and stops Jekyll
#
#
# chkconfig: - 85 15
# description: Jekyll is a Ruby based website caching engine
# processname: jekyll
# pidfile: /var/run/jekyll.pid
# Configure your values here
SOURCE=/opt/dev/mysitecode
DEST=/var/www/html
# Generally, shouldn't need to change below here...
PID_FILE=/var/run/jekyll.pid
LOG_FILE=/var/log/jekyll.log
JEKYLL_EXE=/usr/local/bin/jekyll
case "$1" in
start)
$JEKYLL_EXE $SOURCE $DEST >> $LOG_FILE &
echo $! > $PID_FILE
echo "Jekyll STARTED"
exit 0
;;
stop)
kill -TERM $(cat $PID_FILE)
echo "Jekyll STOPPED"
exit 0
;;
restart)
$0 stop
$0 start
exit 0
;;
status)
ps -p `cat $PID_FILE` > /dev/null 2>&1 && echo "Jekyll Running" || echo "Jekyll Not Running"
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.