tinc/debian/tinc.if-post-down
Guus Sliepen e53cefdf85 Import Debian changes 1.0.23-2
tinc (1.0.23-2) unstable; urgency=low

  * Use if-statements instead of && in shell scripts. Closes: #731279
    The && operator does not clear the error status, and if the next statement
    in a shell script does not change the error status it would cause the
    script to prematurely exit. Thanks to Peter Reinholdtsen for spotting it.
  * Use absolute path to tincd in the if-post-down script.
2019-08-26 13:44:45 +02:00

25 lines
412 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" ] ; do
if [ $i = '30' ] ; then
echo 'Failed to stop tinc daemon!'
exit 1
fi
sleep 0.1
i=$(($i+1))
done
fi
exit 0