2011-06-24 16:21:51 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2011-08-07 08:57:15 +00:00
|
|
|
if [ "$IF_TINC_NET" ] ; then
|
2013-04-23 09:37:38 +00:00
|
|
|
tinc -n "$IF_TINC_NET" stop
|
2011-08-07 08:57:15 +00:00
|
|
|
sleep 0.1
|
|
|
|
i=0;
|
2013-05-01 08:41:31 +00:00
|
|
|
while read pid rest < /var/run/tinc.$IF_TINC_NET.pid ; do
|
|
|
|
if [ ! -e "/proc/$pid" ] ; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2011-08-07 08:57:15 +00:00
|
|
|
if [ $i = '30' ] ; then
|
|
|
|
echo 'Failed to stop tinc daemon!'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sleep 0.1
|
|
|
|
i=$(($i+1))
|
|
|
|
done
|
2016-10-10 20:30:25 +00:00
|
|
|
fi
|
|
|
|
|
2011-06-24 16:21:51 +00:00
|
|
|
exit 0
|