From 6383e456c372e837411683e7ac6353a60b24a8e2 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 10 Apr 2010 18:33:10 +0000 Subject: [PATCH 1/1] [package] ez-ipudate: fix config generator to permit default server This patch allows ez-ipupdate to use the default server for the specified DDNS service type when no server hostname is supplied by the user. In detail: The default config file supplied in the ez-ipupdate package does not include a "server" line, and ez-ipupdate itself does not require an explicit server (since it will select a server based on the service type). Unfortunately, if the user simply fills in the blanks in the OpenWrt-supplied ez-ipupdate config, the service will silently fail to start because the hotplug script inserts a line in the generated config which states "server=", and ez-ipupdate doesn't like a blank server setting. The above scenario doesn't seem like a good user experience, so this is a small patch to the hotplug script to omit the "server" line (and let ez-ipupdate select its own default) in the event that the user has not specified a server. Signed-off-by: Scott Dudley SVN-Revision: 20783 --- net/ez-ipupdate/files/ez-ipupdate.hotplug | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/net/ez-ipupdate/files/ez-ipupdate.hotplug b/net/ez-ipupdate/files/ez-ipupdate.hotplug index 8f924f154f..f07542f4f1 100644 --- a/net/ez-ipupdate/files/ez-ipupdate.hotplug +++ b/net/ez-ipupdate/files/ez-ipupdate.hotplug @@ -25,7 +25,7 @@ case "$ACTION" in config_get pidfile $cfg pidfile pidfile=${pidfile:-/var/run/$NAME-$service-$dev.pid} - + case "$ACTION" in ifdown) cleanup $pidfile @@ -36,7 +36,7 @@ case "$ACTION" in [ ! -e $pidfile ] && { config_get cache $cfg cache [ -z "$cache" ] && cache=/tmp/$NAME-$service-$dev.cache - + config_get config $cfg config [ -z "$config" ] && { config=/var/run/$NAME-$service-$dev.conf @@ -45,9 +45,13 @@ case "$ACTION" in config_get hostname $cfg hostname service=${service:-"dyndns"} config_get server $cfg server + server_line="" + [ -n "$server" ] && { + server_line="server=$server" + } cat > $config <&1 | logger -t $NAME & } ;; @@ -68,12 +72,12 @@ EOF } } } - - + + include /lib/network scan_interfaces config_load ddns - + config_foreach ddns ddns ;; esac -- 2.30.2