2016-03-27 22:17:46 +11:00
|
|
|
#!/usr/bin/env bash
|
2007-04-11 05:56:44 +10:00
|
|
|
#
|
|
|
|
# /etc/rc.d/distccd: start/stop distcc daemon
|
|
|
|
#
|
|
|
|
|
|
|
|
. /etc/rc.conf
|
|
|
|
if [ -z "$DISTCC_ALLOW" ]; then
|
|
|
|
echo "Please define a range of IPs allowed to connect to this distccd"
|
|
|
|
echo "host in DISTCC_ALLOW in /etc/rc.conf. More detailed information"
|
2008-05-18 02:21:39 +10:00
|
|
|
echo "can be found in the distcc's README package."
|
|
|
|
exit 1
|
2007-04-11 05:56:44 +10:00
|
|
|
fi
|
2008-05-18 02:21:39 +10:00
|
|
|
|
|
|
|
DISTCC_USER="${DISTCC_USER:=nobody}"
|
|
|
|
DISTCC_LOG_LEVEL="${DISTCC_LOG_LEVEL:=notice}"
|
2007-04-11 05:56:44 +10:00
|
|
|
|
|
|
|
case $1 in
|
|
|
|
start)
|
2008-05-18 02:21:39 +10:00
|
|
|
/usr/sbin/distccd --daemon --user "$DISTCC_USER" --allow "$DISTCC_ALLOW" --log-level "$DISTCC_LOG_LEVEL"
|
2007-04-11 05:56:44 +10:00
|
|
|
;;
|
|
|
|
stop)
|
2008-05-18 02:21:39 +10:00
|
|
|
killall -q /usr/sbin/distccd
|
2007-04-11 05:56:44 +10:00
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 [start|stop|restart]"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End of file
|