Changeset View
Changeset View
Standalone View
Standalone View
head/net-im/tox12/files/tox-bootstrapd.in
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
svn:keywords | null | FreeBSD=%H \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
#! /bin/sh | |||||
# | |||||
# $FreeBSD$ | |||||
# | |||||
# PROVIDE: tox_bootstrapd | |||||
# REQUIRE: NETWORKING DAEMON | |||||
# KEYWORD: shutdown | |||||
# Add the following line to /etc/rc.conf to enable `tox-bootstrapd': | |||||
# | |||||
#tox_bootstrapd_enable="YES" | |||||
# | |||||
. /etc/rc.subr | |||||
name="tox_bootstrapd" | |||||
rcvar=tox_bootstrapd_enable | |||||
# read settings, set default values | |||||
load_rc_config "${name}" | |||||
: ${tox_bootstrapd_enable="NO"} | |||||
required_files=${tox_bootstrapd_config:="%%PREFIX%%/etc/tox-bootstrapd.conf"} | |||||
_pidprefix="/var/run/tox-bootstrapd" | |||||
pidfile=${tox_bootstrapd_pidfile:="$_pidprefix/tox-bootstrapd.pid"} | |||||
long_name="Tox DHT bootstrap daemon." | |||||
tox_bootstrapd_user="%%TOXDHT%%" | |||||
command="%%PREFIX%%/bin/tox-bootstrapd" | |||||
command_args="--config ${tox_bootstrapd_config}" | |||||
stop_cmd=${name}_stop | |||||
# Cannot use the regular stop() because the daemon forks | |||||
tox_bootstrapd_stop() { | |||||
[ -f $pidfile ] || (echo "$name not running?"; exit 1) | |||||
echo "Stopping $long_name" | |||||
kill `ps ax | grep $command | grep -v grep | awk '{print $1}'` | |||||
rm -f $pidfile | |||||
} | |||||
run_rc_command "$1" |