diff options
Diffstat (limited to 'security/tinc/files/tincd.in')
-rw-r--r-- | security/tinc/files/tincd.in | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/security/tinc/files/tincd.in b/security/tinc/files/tincd.in index 4a7c965cd815..c3f1e7acb9c3 100644 --- a/security/tinc/files/tincd.in +++ b/security/tinc/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/tincd" 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 $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() +{ rc_pid=$(check_pidfile "$pidfile" "$_procname" "$command_interpreter") if [ -n "$rc_pid" ]; then echo "${name} for ${cfg} is running as pid $rc_pid." @@ -95,6 +101,7 @@ tincd_status_network() { return 1 fi } + tincd_status() { if test -z "${tincd_cfg}" @@ -112,4 +119,3 @@ tincd_status() } run_rc_command "$1" -# eof |