tinc/debian/tinc.if-pre-up
Michael Tokarev cc0493ea17 Import Debian changes 1.0.19-2~bpo60+1
tinc (1.0.19-2~bpo60+1) squeeze-backports; urgency=low

  * Rebuild for squeeze-backports.
  * Build-depend on libvdeplug2-dev, not libvdeplug-dev,
    as it is how it is named in squeeze.

tinc (1.0.19-2) unstable; urgency=low

  * Fix behaviour of tinc-pidfile. Closes: #679130
  * Enable parallel building in debian/rules.
2019-08-26 13:44:43 +02:00

39 lines
983 B
Bash
Executable file

#!/bin/sh
set -e
[ -z "$IF_TINC_NET" ] && exit 0
# Read options from /etc/default
. /etc/default/tinc
# Read options from /etc/network/interfaces
[ -n "$IF_TINC_CONFIG" ] && EXTRA="$EXTRA -c $IF_TINC_CONFIG"
[ -n "$IF_TINC_DEBUG" ] && EXTRA="$EXTRA -d$IF_TINC_DEBUG"
[ -n "$IF_TINC_MLOCK" ] && EXTRA="$EXTRA --mlock"
[ -n "$IF_TINC_LOGFILE" ] && EXTRA="$EXTRA --logfile=$IF_TINC_LOGFILE"
[ -n "$IF_TINC_PIDFILE" ] && EXTRA="$EXTRA --pidfile=$IF_TINC_PIDFILE" || IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid
[ -n "$IF_TINC_CHROOT" ] && EXTRA="$EXTRA --chroot"
[ -n "$IF_TINC_USER" ] && EXTRA="$EXTRA --user=$IF_TINC_USER"
# Start tinc daemon
/usr/sbin/tincd -n "$IF_TINC_NET" -o "Interface=$IFACE" $EXTRA
# Wait for it to come up properly
sleep 0.1
i=0;
while [ ! -f "$IF_TINC_PIDFILE" ] ; do
if [ $i = '30' ] ; then
echo 'Failed to start tinc daemon!'
exit 1
fi
sleep 0.1
i=$(($i+1))
done
exit 0