2011-06-24 16:21:51 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ "$IF_TINC_NET" ] ; then
|
2012-12-28 19:49:04 +00:00
|
|
|
EXTRA=""
|
2013-12-05 09:41:13 +00:00
|
|
|
if [ -n "$IF_TINC_PIDFILE" ]; then
|
|
|
|
EXTRA="--pidfile=$IF_TINC_PIDFILE"
|
|
|
|
else
|
|
|
|
IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid
|
|
|
|
fi
|
|
|
|
/usr/sbin/tincd -n "$IF_TINC_NET" -k $EXTRA
|
2011-06-24 16:21:51 +00:00
|
|
|
sleep 0.1
|
|
|
|
i=0;
|
2012-12-28 19:49:04 +00:00
|
|
|
while [ -f "$IF_TINC_PIDFILE" ] ; do
|
2011-06-24 16:21:51 +00:00
|
|
|
if [ $i = '30' ] ; then
|
|
|
|
echo 'Failed to stop tinc daemon!'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sleep 0.1
|
|
|
|
i=$(($i+1))
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|