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=""
|
|
|
|
[ -n "$IF_TINC_PIDFILE" ] && EXTRA="--pidfile=$IF_TINC_PIDFILE" || IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid
|
|
|
|
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
|