Skip to content

Instantly share code, notes, and snippets.

@srounet
Last active December 28, 2015 12:29
Show Gist options
  • Save srounet/7501346 to your computer and use it in GitHub Desktop.
Save srounet/7501346 to your computer and use it in GitHub Desktop.
Delegated rc.d for FreeBSD 9.1
#!/bin/sh
. /etc/rc.subr
name="delegated"
rcvar=delegated_enable
load_rc_config ${name}
: ${delegated_pidfile="/var/run/delegated/delegated.pid"}
max=15
for i in `seq 1 $max`
do
pidfile=${delegated_pidfile}$i
command="/usr/local/sbin/${name}"
command_args="-P$((9150 + i)) SERVER=http SOCKS=localhost:$((9050 + 1)) PIDFILE=${pidfile} OWNER=root/wheel"
run_rc_command "$1"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment