Ignore:
Timestamp:
2010-04-10T20:33:10+02:00 (6 years ago)
Author:
florian
Message:

[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 <spmsink@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/ez-ipupdate/files/ez-ipupdate.hotplug

    r20654 r20783  
    2626                    config_get pidfile $cfg pidfile 
    2727                    pidfile=${pidfile:-/var/run/$NAME-$service-$dev.pid} 
    28                              
     28 
    2929                    case "$ACTION" in 
    3030                        ifdown) 
     
    3737                                        config_get cache $cfg cache 
    3838                                        [ -z "$cache" ] && cache=/tmp/$NAME-$service-$dev.cache 
    39                                          
     39 
    4040                                        config_get config $cfg config 
    4141                                        [ -z "$config" ] && { 
     
    4646                                            service=${service:-"dyndns"} 
    4747                                            config_get server   $cfg server 
     48                                            server_line="" 
     49                                            [ -n "$server" ] && { 
     50                                                server_line="server=$server" 
     51                                            } 
    4852                                            cat > $config <<EOF 
    4953service-type=$service 
    50 ${server:+server=$server} 
     54$server_line 
    5155user=$username:$password 
    5256host=$hostname 
     
    5761EOF 
    5862                                        } 
    59                                          
     63 
    6064                                        $COMMAND -c $config 2>&1 | logger -t $NAME & 
    6165                                    } 
     
    6973            } 
    7074        } 
    71          
    72          
     75 
     76 
    7377        include /lib/network 
    7478        scan_interfaces 
    7579        config_load ddns 
    76          
     80 
    7781        config_foreach ddns ddns 
    7882        ;; 
Note: See TracChangeset for help on using the changeset viewer.