diff --git a/debian/changelog b/debian/changelog index a390b69..55d48fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +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. + + -- Guus Sliepen Thu, 05 Dec 2013 09:41:13 +0000 + tinc (1.0.23-1) unstable; urgency=low * New upstream release. diff --git a/debian/tinc.if-post-down b/debian/tinc.if-post-down index fb77810..60c2d51 100755 --- a/debian/tinc.if-post-down +++ b/debian/tinc.if-post-down @@ -4,8 +4,12 @@ set -e if [ "$IF_TINC_NET" ] ; then 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 + 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 diff --git a/debian/tinc.if-pre-up b/debian/tinc.if-pre-up index 99d36ca..ee7b82d 100755 --- a/debian/tinc.if-pre-up +++ b/debian/tinc.if-pre-up @@ -2,7 +2,9 @@ set -e -[ -z "$IF_TINC_NET" ] && exit 0 +if [ -z "$IF_TINC_NET" ]; then + exit 0 +fi # Read options from /etc/default diff --git a/debian/tinc.if-up b/debian/tinc.if-up index 2da794f..364f88f 100755 --- a/debian/tinc.if-up +++ b/debian/tinc.if-up @@ -2,7 +2,8 @@ set -e -[ "$METHOD" = loopback ] && exit 0 -[ -n "$IF_TINC_NET" ] && exit 0 +if [ "$METHOD" = loopback -o -n "$IF_TINC_NET" ]; then + exit 0 +fi invoke-rc.d tinc alarm || exit 0