6 local cfg="$CONFIG_SECTION"
8 config_get cfgtype "$cfg" TYPE
9 dudders=/usr/bin/dudders
13 config_get enabled $cfg enabled
14 [ "$enabled" = "yes" ] || return 0
16 config_get tcp $cfg tcp
17 config_get keyname $cfg keyname
18 config_get mname $cfg mname
19 config_get zone $cfg zone
20 config_get keyfile $cfg keyfile
21 config_get hostname $cfg hostname
22 config_get ttl $cfg ttl
24 [ -r "$keyfile" ] || return 1
26 interface=$(route -n 2>&- \
28 |sed -e 's/.* \([^ ]\+\)$/\1/')
29 [ -z "$interface" ] && return 0
30 [ "$DEVICE" = "$interface" -o \
31 "$IFNAME" = "$interface" -o \
32 "$PPP_IFACE" = "$interface" ] || return 0
33 ipaddr=${PPP_LOCAL:-${IPLOCAL:-$(ifconfig "$interface" \
34 |grep -o 'addr:[^ ]\+' \
35 |sed -e 's/addr://')}}
36 OPTS=${keyname:+" -k '$keyname'"}
37 [ "$tcp" = "yes" ] && OPTS=$OPTS" -T"
38 OPTS=$OPTS${mname:+" -m '$mname'"}
39 OPTS=$OPTS${zone:+" -z '$zone'"}
40 eval $dudders -k $keyfile $OPTS $hostname $ttl $ipaddr
44 case "${ACTION:-ifup}" in
45 ifup) config_load dudders ;;