Last active 4 days ago

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