diff options
author | dinoex <dinoex@FreeBSD.org> | 2008-10-26 21:01:46 +0800 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2008-10-26 21:01:46 +0800 |
commit | 40bf5294b3259414f72a89d7a9316b3d3abbe375 (patch) | |
tree | 3758e640ee93b53ab1c2e680202dd057a59e8e23 | |
parent | d1b1acf031f81ca872eafbcd8ca8e3e7790eb4d1 (diff) | |
download | freebsd-ports-gnome-40bf5294b3259414f72a89d7a9316b3d3abbe375.tar.gz freebsd-ports-gnome-40bf5294b3259414f72a89d7a9316b3d3abbe375.tar.zst freebsd-ports-gnome-40bf5294b3259414f72a89d7a9316b3d3abbe375.zip |
- add tincd startup script
Submitted by: igor <soft[at]antrax-energo.msk.ru>
-rw-r--r-- | security/tinc/Makefile | 3 | ||||
-rw-r--r-- | security/tinc/files/tincd.sh.in | 84 |
2 files changed, 86 insertions, 1 deletions
diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 8b4f2b553b2c..89905db00f47 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -8,7 +8,7 @@ PORTNAME= tinc PORTVERSION= 1.0.8 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= http://www.tinc-vpn.org/packages/ \ ftp://ftp.wiretapped.net/pub/security/network-security/tinc/ \ @@ -25,6 +25,7 @@ CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ARGS= --localstatedir=/var CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +USE_RC_SUBR= tincd.sh MAN5= tinc.conf.5 MAN8= tincd.8 diff --git a/security/tinc/files/tincd.sh.in b/security/tinc/files/tincd.sh.in new file mode 100644 index 000000000000..c23aa6a81f28 --- /dev/null +++ b/security/tinc/files/tincd.sh.in @@ -0,0 +1,84 @@ +#!/bin/sh +# + +# PROVIDE: tinc +# REQUIRE: ipfilter FILESYSTEMS sysctl netif +# BEFORE: SERVERS +# KEYWORD: nojail + +# Define these tincd_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/threeproxy +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE + +tincd_enable=${tincd_enable:-"NO"} + +. /etc/rc.subr + +name="tincd" +rcvar=`set_rcvar` +command="%%PREFIX%%/sbin/tincd" +start_cmd="tincd_start" +stop_cmd="tincd_stop" +reload_cmd="tincd_restart" +extra_commands="reload" +procname=${command:-tincd} + +load_rc_config $name + +tincd_start() +{ + if test -z $tincd_cfg + then + echo "Starting tincd" + $command + else + echo "Starting tincd for: $tincd_cfg" + for cfg in $tincd_cfg + do + $command -n $cfg + done + fi +# code deliberately borrowed from /etc/rc.d/netif + if [ -f /etc/rc.d/ipfilter ] ; then + # Resync ipfilter + /etc/rc.d/ipfilter resync + fi + if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then + /etc/rc.d/bridge start $cmdifn + fi + +} +tincd_stop() +{ + if test -z $tincd_cfg + then + echo "Stopping tincd" + $command -k + else + echo "Stopping tincd for: $tincd_cfg" + for cfg in $tincd_cfg + do + $command -n $cfg -k + done + fi +} +tincd_restart() +{ + if test -z $tincd_cfg + then + echo "Sending HUP to tincd" + $command -k HUP + else + echo "Sending HUP tincd for: $tincd_cfg" + for cfg in $tincd_cfg + do + $command -n $cfg -k HUP + done + fi +} + +run_rc_command "$1" +# eof |