Ignore:
Timestamp:
2010-05-30T20:23:43+02:00 (7 years ago)
Author:
jow
Message:

[package] base-files:

  • use add_dns() and remove_dns() for when changing resolv.conf.auto for static or dhcp interfaces
  • force 0644 permissions when creating resolv.conf.auto, fixes dnsmasq permissions denied problem with pppd interfaces
  • revert dns servers in /sbin/ifdown
  • bump package revision
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/usr/share/udhcpc/default.script

    r21490 r21638  
    140140 
    141141        # DNS 
    142         config_get old_dns "$ifc" dns 
     142        old_dns=$(uci_get_state network "$ifc" dns) 
     143        old_domain=$(uci_get_state network "$ifc" dnsdomain) 
    143144        user_dns=$(uci_get "network.$ifc.dns") 
    144145        [ -n "$user_dns" ] && dns="$user_dns" 
    145146 
    146         [ -n "$dns" ] && [ ! -s "${RESOLV_CONF}" -o "$dns" != "$old_dns" ] && { 
     147        [ -n "$dns" ] && [ "$dns" != "$old_dns" -o -n "$user_dns" ] && { 
    147148                echo "udhcpc: setting dns servers: $dns" 
    148                 echo -n > "${RESOLV_CONF}.tmp" 
    149                 for i in $dns ; do 
    150                         echo "nameserver $i" >> "${RESOLV_CONF}.tmp" 
    151                 done 
    152                 ${domain:+echo search $domain} >> "${RESOLV_CONF}.tmp" 
    153                 mv "${RESOLV_CONF}.tmp" "$RESOLV_CONF" 
    154  
    155                 change_state network "$ifc" dnsdomain "$domain" 
    156                 change_state network "$ifc" dns "$dns" 
     149                add_dns "$ifc" $dns 
     150 
     151                [ -n "$domain" ] && [ "$domain" != "$old_domain" ] && { 
     152                        echo "udhcpc: setting dns domain: $domain" 
     153                        sed -i -e "${old_domain:+/^search $old_domain$/d; }/^search $domain$/d" "${RESOLV_CONF}" 
     154                        echo "search $domain" >> "${RESOLV_CONF}" 
     155                        change_state network "$ifc" dnsdomain "$domain" 
     156                } 
    157157        } 
    158158 
Note: See TracChangeset for help on using the changeset viewer.