thelounge
· 688 B · Text
Raw
#!/bin/sh
# PROVIDE: thelounge
# REQUIRE: networking
# KEYWORD: shutdown
. /etc/rc.subr
name="thelounge"
rcvar="thelounge_enable"
start_precmd="thelounge_precmd"
procname="/usr/local/bin/node"
pidfile="/var/run/${name}.pid"
load_rc_config $name
: ${thelounge_enable:="NO"}
: ${thelounge_home:="/usr/local/etc/thelounge"}
: ${thelounge_user:="thelounge"}
export THELOUNGE_HOME=${thelounge_home}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} /usr/local/bin/node /usr/local/bin/thelounge start"
thelounge_precmd() {
if [ ! -e "${pidfile}" ]; then
install -o "${thelounge_user}" -g "wheel" "/dev/null" "${pidfile}"
fi
}
run_rc_command "$1"
| 1 | #!/bin/sh |
| 2 | |
| 3 | # PROVIDE: thelounge |
| 4 | # REQUIRE: networking |
| 5 | # KEYWORD: shutdown |
| 6 | |
| 7 | . /etc/rc.subr |
| 8 | |
| 9 | name="thelounge" |
| 10 | rcvar="thelounge_enable" |
| 11 | start_precmd="thelounge_precmd" |
| 12 | procname="/usr/local/bin/node" |
| 13 | pidfile="/var/run/${name}.pid" |
| 14 | |
| 15 | load_rc_config $name |
| 16 | |
| 17 | : ${thelounge_enable:="NO"} |
| 18 | : ${thelounge_home:="/usr/local/etc/thelounge"} |
| 19 | : ${thelounge_user:="thelounge"} |
| 20 | |
| 21 | export THELOUNGE_HOME=${thelounge_home} |
| 22 | |
| 23 | command="/usr/sbin/daemon" |
| 24 | command_args="-f -p ${pidfile} /usr/local/bin/node /usr/local/bin/thelounge start" |
| 25 | |
| 26 | thelounge_precmd() { |
| 27 | if [ ! -e "${pidfile}" ]; then |
| 28 | install -o "${thelounge_user}" -g "wheel" "/dev/null" "${pidfile}" |
| 29 | fi |
| 30 | } |
| 31 | |
| 32 | run_rc_command "$1" |