Skip to content

Instantly share code, notes, and snippets.

@jgillich
Created October 18, 2013 18:01
Show Gist options
  • Save jgillich/7045531 to your computer and use it in GitHub Desktop.
Save jgillich/7045531 to your computer and use it in GitHub Desktop.
Ghost service script for FreeBSD
#!/bin/sh
# PROVIDE: ghost
# KEYWORD: shutdown
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
. /etc/rc.subr
name="ghost"
rcvar=${name}_enable
load_rc_config ${name}
: ${ghost_enable:="NO"}
start_cmd="${name}_start"
stop_cmd="${name}_stop"
ghost_start() {
cd /www/ghost && sudo -u ghost sh -c "NODE_ENV=production forever start -al /var/log/ghost index.js"
}
ghost_stop() {
cd /www/ghost && sudo -u ghost sh -c "NODE_ENV=production forever stop index.js"
}
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment