a bug in dhcp exit hook script of ddclient

Bug #1704159 reported by Dmitry Redkin on 2017-07-13
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ddclient (Debian)
New
Unknown
ddclient (Ubuntu)
Undecided
Unassigned

Bug Description

the ddclient DHCP exit hook script looks like:

[ -x /usr/sbin/ddclient ] || exit 0
[ -f /etc/default/ddclient ] || exit 0
. /etc/default/ddclient
[ $run_dhclient = "true" ] || exit 0

case $reason in
    BOUND | RENEW | REBIND)
        /usr/bin/logger -t dhclient $reason, updating IP address with ddclient
        /usr/sbin/ddclient -daemon=0 -syslog > /dev/null 2>&1
        ;;
    *)
        ;;
esac

The error is on line 7. As all the shell programming guides say, when checking a variable you have to quote it, or in case the variable is null (as it is in my case) you will get an error:

/sbin/dhclient-script: 7: [: =: unexpected operator

so the correct line 7 for this script is:

[ "$run_dhclient" = "true" ] || exit 0

Please fix it in LTS also as people start to complain on the forums about this bug already.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ddclient (Ubuntu):
status: New → Confirmed
Manfred (mejf) wrote :

This bug caused me several hours of headscratching and work. :-(

Changed in ddclient (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.