088ed763df
tinc (1.0.26-1) unstable; urgency=medium * New upstream release. * Use the contents, not the presence, of the pidfile to check that tincd is shut down properly. Closes: #774682 * Bump Standards-Version.
29 lines
496 B
Bash
Executable file
29 lines
496 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ "$IF_TINC_NET" ] ; then
|
|
EXTRA=""
|
|
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
|
|
sleep 0.1
|
|
i=0;
|
|
while [ -f $IF_TINC_PIDFILE ] && read pid rest < $IF_TINC_PIDFILE ; do
|
|
if [ ! -e "/proc/$pid" ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
if [ $i = '30' ] ; then
|
|
echo 'Failed to stop tinc daemon!'
|
|
exit 1
|
|
fi
|
|
sleep 0.1
|
|
i=$(($i+1))
|
|
done
|
|
fi
|
|
|
|
exit 0
|