123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- #!/bin/sh
- tincd_enable=${tincd_enable:-"NO"}
- . /etc/rc.subr
- name="tincd"
- rcvar="tincd_enable"
- command="/usr/local/sbin/tincd"
- start_cmd="tincd_start"
- stop_cmd="tincd_stop"
- reload_cmd="tincd_reload"
- extra_commands="reload"
- procname=${command:-tincd}
- ldconfig_command="/sbin/ldconfig"
- load_rc_config $name
- tincd_start()
- {
- local setfib
- setfib=/usr/sbin/setfib
- ${ldconfig_command} -elf -m /usr/local/lib
- if test -z "${tincd_cfg}"
- then
- eval tincd_fib=\$${name}_fib
- if [ -n "${tincd_fib}" ]
- then
- procname="${command}"
- echo "Starting tincd"
- $setfib -F ${tincd_fib} $command ${command_args}
- else
- echo "Starting tincd"
- $command ${command_args}
- fi
- else
- for cfg in ${tincd_cfg}
- do
- eval tincd_fib=\$${name}_${cfg}_fib
- command_args="-n $cfg"
- if [ -n "${tincd_fib}" ]
- then
- procname="${command}"
- echo "Starting tincd"
- $setfib -F ${tincd_fib} $command ${command_args}
- else
- echo "Starting tincd for: ${cfg}"
- $command ${command_args}
- fi
- done
- fi
- if [ -f /etc/rc.d/ipfilter ] ; then
-
- /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
- }
- 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
- }
- run_rc_command "$1"
|