Ticket #24703: vpnc-script.patch

File vpnc-script.patch, 1.7 KB (added by neville@…, 15 years ago)

Patch to vpnc-script

  • vpnc-script

    old new  
    7979elif [ -x /sbin/modify_resolvconf ]; then # Mandatory tool on Suse earlier than 11.1
    8080        MODIFYRESOLVCONF=modify_resolvconf_suse
    8181        RESTORERESOLVCONF=restore_resolvconf_suse
     82elif [ -x /usr/sbin/networksetup ]; then # Tool on OSX Snow Leopard
     83        MODIFYRESOLVCONF=modify_resolvconf_networksetup
     84        RESTORERESOLVCONF=restore_resolvconf_networksetup
    8285else # Generic for any OS
    8386        MODIFYRESOLVCONF=modify_resolvconf_generic
    8487        RESTORERESOLVCONF=restore_resolvconf_generic
     
    382385        /sbin/resolvconf -d $TUNDEV
    383386}
    384387
     388# === resolv.conf handling via networksetup (OSX [Snow Leopard])) =========
     389
     390modify_resolvconf_networksetup() {
     391        NEW_RESOLVCONF=""
     392        for i in $INTERNAL_IP4_DNS; do
     393                NEW_RESOLVCONF="$NEW_RESOLVCONF $i"
     394        done
     395        echo /usr/sbin/networksetup -setdnsservers AirPort $NEW_RESOLVCONF
     396        /usr/sbin/networksetup -setdnsservers AirPort $NEW_RESOLVCONF
     397        /usr/sbin/networksetup -setdnsservers Ethernet $NEW_RESOLVCONF
     398        if [ -n "$CISCO_DEF_DOMAIN" ]; then
     399                echo /usr/sbin/networksetup -setsearchdomains AirPort $CISCO_DEF_DOMAIN
     400                /usr/sbin/networksetup -setsearchdomains AirPort $CISCO_DEF_DOMAIN
     401                /usr/sbin/networksetup -setsearchdomains Ethernet $CISCO_DEF_DOMAIN
     402        fi
     403}
     404
     405restore_resolvconf_networksetup() {
     406        /usr/sbin/networksetup -setdnsservers AirPort empty
     407        /usr/sbin/networksetup -setdnsservers Ethernet empty
     408        /usr/sbin/networksetup -setsearchdomains AirPort empty
     409        /usr/sbin/networksetup -setsearchdomains Ethernet empty
     410}
     411
    385412# ========= Toplevel state handling  =======================================
    386413
    387414kernel_is_2_6_or_above() {