Index: head/security/tinc/Makefile =================================================================== --- head/security/tinc/Makefile (revision 529265) +++ head/security/tinc/Makefile (revision 529266) @@ -1,28 +1,29 @@ # Created by: ijliao # $FreeBSD$ PORTNAME= tinc PORTVERSION= 1.0.36 +PORTREVISION= 1 CATEGORIES= security net-vpn MASTER_SITES= https://www.tinc-vpn.org/packages/ \ http://www.tinc-vpn.org/packages/ MAINTAINER= dinoex@FreeBSD.org COMMENT= Virtual Private Network (VPN) daemon LICENSE= GPLv3 LIB_DEPENDS= liblzo2.so:archivers/lzo2 USES= cpe ssl makeinfo CPE_VENDOR= tinc-vpn GNU_CONFIGURE= yes CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ARGS= --localstatedir=/var USE_RC_SUBR= tincd INFO= tinc PLIST_FILES= sbin/tincd \ man/man5/tinc.conf.5.gz man/man8/tincd.8.gz .include Index: head/security/tinc/files/tincd.in =================================================================== --- head/security/tinc/files/tincd.in (revision 529265) +++ head/security/tinc/files/tincd.in (revision 529266) @@ -1,90 +1,115 @@ #!/bin/sh # $FreeBSD$ # # PROVIDE: tincd # REQUIRE: ipfilter FILESYSTEMS sysctl netif # BEFORE: SERVERS routing # # Define these tincd_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/tincd # # tincd_enable (bool): Set to "NO" by default. # Set it to "YES" to enable tincd. # tincd_cfg (str): Set to "" by default. # Set it to NETNAMEs to use (ex.: "vpn1 vpn2"). # tincd_flags (str): Set to "" by default. # Set it to flags to use (ex.: "-d 1 --logfile"). # # DO NOT CHANGE THESE DEFAULT VALUES HERE tincd_enable=${tincd_enable:-"NO"} . /etc/rc.subr name="tincd" rcvar="tincd_enable" command="%%PREFIX%%/sbin/tincd" start_cmd="tincd_start" stop_cmd="tincd_stop" reload_cmd="tincd_reload" +status_cmd="tincd_status" extra_commands="reload" procname=${command:-tincd} ldconfig_command="/sbin/ldconfig" load_rc_config $name tincd_start() { ${ldconfig_command} -elf -m %%LOCALBASE%%/lib if test -z "${tincd_cfg}" then echo "Starting tincd" $command else for cfg in ${tincd_cfg} do echo "Starting tincd for: ${cfg}" $command -n $cfg $tincd_flags done fi # code deliberately borrowed from /etc/rc.d/netif if [ -f /etc/rc.d/ipfilter ] ; then # Resync ipfilter /etc/rc.d/ipfilter quietresync fi } tincd_stop() { if test -z "${tincd_cfg}" then echo "Stopping tincd" $command -k else for cfg in $tincd_cfg do echo "Stopping tincd for: ${cfg}" $command -n $cfg -k done fi wait_for_pids $rc_pid } tincd_reload() { if test -z "${tincd_cfg}" then echo "Sending HUP to tincd" $command --kill=HUP else for cfg in $tincd_cfg do echo "Sending HUP to tincd for: ${cfg}" $command -n $cfg --kill=HUP + done + fi +} +tincd_status_network() { + rc_pid=$(check_pidfile "$pidfile" "$_procname" "$command_interpreter") + if [ -n "$rc_pid" ]; then + echo "${name} for ${cfg} is running as pid $rc_pid." + else + echo "${name} for ${cfg} is not running." + return 1 + fi +} +tincd_status() +{ + if test -z "${tincd_cfg}" + then + cfg="." + pidfile="/var/run/tinc.pid" + tincd_status_network + else + for cfg in $tincd_cfg + do + pidfile="/var/run/tinc.${cfg}.pid" + tincd_status_network done fi } run_rc_command "$1" # eof Index: head/security/tinc-devel/Makefile =================================================================== --- head/security/tinc-devel/Makefile (revision 529265) +++ head/security/tinc-devel/Makefile (revision 529266) @@ -1,29 +1,29 @@ # $FreeBSD$ PORTNAME= tinc PORTVERSION= 1.1pre17 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= security net-vpn MASTER_SITES= https://www.tinc-vpn.org/packages/ \ http://www.tinc-vpn.org/packages/ PKGNAMESUFFIX= -devel MAINTAINER= dinoex@FreeBSD.org COMMENT= Virtual Private Network (VPN) daemon LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= liblzo2.so:archivers/lzo2 USES= cpe ssl makeinfo readline localbase:ldflags CPE_VENDOR= tinc-vpn GNU_CONFIGURE= yes CONFIGURE_ARGS= --localstatedir=/var --with-curses=/usr USE_RC_SUBR= tincd INFO= tinc PLIST_FILES= sbin/tincd sbin/tinc \ man/man8/tinc-gui.8.gz man/man5/tinc.conf.5.gz \ man/man8/tinc.8.gz man/man8/tincd.8.gz .include Index: head/security/tinc-devel/files/tincd.in =================================================================== --- head/security/tinc-devel/files/tincd.in (revision 529265) +++ head/security/tinc-devel/files/tincd.in (revision 529266) @@ -1,90 +1,114 @@ #!/bin/sh # $FreeBSD$ # # PROVIDE: tincd # REQUIRE: ipfilter FILESYSTEMS sysctl netif # BEFORE: SERVERS routing # # Define these tincd_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/tincd # # tincd_enable (bool): Set to "NO" by default. # Set it to "YES" to enable tincd. # tincd_cfg (str): Set to "" by default. # Set it to NETNAMEs to use (ex.: "vpn1 vpn2"). # tincd_flags (str): Set to "" by default. # Set it to flags to use (ex.: "-d 1 --logfile"). # # DO NOT CHANGE THESE DEFAULT VALUES HERE tincd_enable=${tincd_enable:-"NO"} . /etc/rc.subr name="tincd" rcvar="tincd_enable" command="%%PREFIX%%/sbin/tinc" start_cmd="tincd_start" stop_cmd="tincd_stop" reload_cmd="tincd_reload" +status_cmd="tincd_status" extra_commands="reload" procname=${command:-tincd} ldconfig_command="/sbin/ldconfig" load_rc_config $name tincd_start() { ${ldconfig_command} -elf -m %%LOCALBASE%%/lib if test -z "${tincd_cfg}" then echo "Starting tincd" $command start else for cfg in ${tincd_cfg} do echo "Starting tincd for: ${cfg}" $command -n $cfg start $tincd_flags done fi # code deliberately borrowed from /etc/rc.d/netif if [ -f /etc/rc.d/ipfilter ] ; then # Resync ipfilter /etc/rc.d/ipfilter quietresync fi } tincd_stop() { if test -z "${tincd_cfg}" then echo "Stopping tincd" $command stop else for cfg in $tincd_cfg do echo "Stopping tincd for: ${cfg}" $command -n $cfg stop done fi wait_for_pids $rc_pid } tincd_reload() { if test -z "${tincd_cfg}" then echo "Sending reload to tincd" $command reload else for cfg in $tincd_cfg do echo "Sending reload to tincd for: ${cfg}" $command -n $cfg reload + done + fi +} +tincd_status_network() { + if [ -n "$rc_pid" ]; then + echo "${name} for ${cfg} is running as pid $rc_pid." + else + echo "${name} for ${cfg} is not running." + return 1 + fi +} +tincd_status() +{ + if test -z "${tincd_cfg}" + then + cfg="." + rc_pid=$($command pid) + tincd_status_network + else + for cfg in $tincd_cfg + do + rc_pid=$($command -n $cfg pid) + tincd_status_network done fi } run_rc_command "$1" # eof