aboutsummaryrefslogtreecommitdiff
path: root/security/tinc-devel
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2020-03-27 16:02:48 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2020-03-27 16:02:48 +0000
commit38eecc963d97d83a7ec535743042f887a62974e6 (patch)
treeaf2be168ad48cdd35e241ce9f01bf480e232ac30 /security/tinc-devel
parentdeb85cc35d2351b1dc312d39cb5e8bbec92566ff (diff)
downloadports-38eecc963d97d83a7ec535743042f887a62974e6.tar.gz
ports-38eecc963d97d83a7ec535743042f887a62974e6.zip
- fix "service tincd status" for multiple instances
PR: 245095 Submitted by: errit@weinberg2.de
Notes
Notes: svn path=/head/; revision=529266
Diffstat (limited to 'security/tinc-devel')
-rw-r--r--security/tinc-devel/Makefile2
-rw-r--r--security/tinc-devel/files/tincd.in24
2 files changed, 25 insertions, 1 deletions
diff --git a/security/tinc-devel/Makefile b/security/tinc-devel/Makefile
index 37fa08fce688..412f7d2769c2 100644
--- a/security/tinc-devel/Makefile
+++ b/security/tinc-devel/Makefile
@@ -2,7 +2,7 @@
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/
diff --git a/security/tinc-devel/files/tincd.in b/security/tinc-devel/files/tincd.in
index e79b688d8f91..e6ffff60a737 100644
--- a/security/tinc-devel/files/tincd.in
+++ b/security/tinc-devel/files/tincd.in
@@ -30,6 +30,7 @@ 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"
@@ -85,6 +86,29 @@ tincd_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