Created
October 18, 2013 18:01
-
-
Save jgillich/7045531 to your computer and use it in GitHub Desktop.
Ghost service script for FreeBSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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