summaryrefslogtreecommitdiff
path: root/security/tinc-devel
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2020-04-16 14:49:59 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2020-04-16 14:49:59 +0000
commitae5215e025daae99b3ebfe22cd65310eebbdfc70 (patch)
tree95bc399a7e716d1a06cd630891cabc9b67eedc7b /security/tinc-devel
parentscience/erkale: fix build on GCC architectures (diff)
- cleanup rc.d script
Notes
Notes: svn path=/head/; revision=531850
Diffstat (limited to 'security/tinc-devel')
-rw-r--r--security/tinc-devel/Makefile2
-rw-r--r--security/tinc-devel/files/tincd.in22
2 files changed, 15 insertions, 9 deletions
diff --git a/security/tinc-devel/Makefile b/security/tinc-devel/Makefile
index 412f7d2769c2..de42cd6cab3c 100644
--- a/security/tinc-devel/Makefile
+++ b/security/tinc-devel/Makefile
@@ -2,7 +2,7 @@
PORTNAME= tinc
PORTVERSION= 1.1pre17
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= security net-vpn
MASTER_SITES= https://www.tinc-vpn.org/packages/ \
http://www.tinc-vpn.org/packages/
diff --git a/security/tinc-devel/files/tincd.in b/security/tinc-devel/files/tincd.in
index e6ffff60a737..99085ad84352 100644
--- a/security/tinc-devel/files/tincd.in
+++ b/security/tinc-devel/files/tincd.in
@@ -1,10 +1,11 @@
#!/bin/sh
-
+#
# $FreeBSD$
#
# PROVIDE: tincd
# REQUIRE: ipfilter FILESYSTEMS sysctl netif
# BEFORE: SERVERS routing
+# KEYWORD: shutdown
#
# Define these tincd_* variables in one of these files:
# /etc/rc.conf
@@ -20,12 +21,15 @@
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
-tincd_enable=${tincd_enable:-"NO"}
-
. /etc/rc.subr
name="tincd"
+desc="Tinc VPN Daemon"
rcvar="tincd_enable"
+
+load_rc_config $name
+
+: ${tincd_enable:="NO"}
command="%%PREFIX%%/sbin/tinc"
start_cmd="tincd_start"
stop_cmd="tincd_stop"
@@ -35,8 +39,6 @@ extra_commands="reload"
procname=${command:-tincd}
ldconfig_command="/sbin/ldconfig"
-load_rc_config $name
-
tincd_start()
{
${ldconfig_command} -elf -m %%LOCALBASE%%/lib
@@ -51,12 +53,13 @@ tincd_start()
$command -n $cfg start $tincd_flags
done
fi
-# code deliberately borrowed from /etc/rc.d/netif
+ # 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}"
@@ -72,6 +75,7 @@ tincd_stop()
fi
wait_for_pids $rc_pid
}
+
tincd_reload()
{
if test -z "${tincd_cfg}"
@@ -86,7 +90,9 @@ tincd_reload()
done
fi
}
-tincd_status_network() {
+
+tincd_status_network()
+{
if [ -n "$rc_pid" ]; then
echo "${name} for ${cfg} is running as pid $rc_pid."
else
@@ -94,6 +100,7 @@ tincd_status_network() {
return 1
fi
}
+
tincd_status()
{
if test -z "${tincd_cfg}"
@@ -111,4 +118,3 @@ tincd_status()
}
run_rc_command "$1"
-# eof