Giter Club home page Giter Club logo

Comments (1)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
I solved the issue by modifying a couple lines of code in the vpnc-script file. 
Maybe this could be added in the next release? See below:

Replace the modify_resolvconf_android() function with this:

modify_resolvconf_android() {
        echo "backing up dns and resolve.conf"
        INTERNAL_IP4_DNS_TEMP="$INTERNAL_IP4_DNS"

        PREVIOUS_DNS1=`getprop net.dns1`
        PREVIOUS_DNS2=`getprop net.dns2`
        PREVIOUS_DNSSEARCH=`getprop net.dns.search`

        echo $PREVIOUS_DNS1 > `dirname $0`/dns1.txt
        echo $PREVIOUS_DNS2 > `dirname $0`/dns2.txt
        echo $PREVIOUS_DNSSEARCH > `dirname $0`/dnssearch.txt

        RESOLV_CONF_BACKUP=`dirname $0`/resolv.conf-backup
        cp /etc/resolv.conf $RESOLV_CONF_BACKUP

        N=1

        for i in $INTERNAL_IP4_DNS; do
                setprop net.dns$N $i
                N=`expr $N + 1`
        done

        setprop net.dns.search $CISCO_DEF_DOMAIN

}

Replace the restore_resolvconf_android() function with this:

restore_resolvconf_android() {
        RESOLV_CONF_BACKUP=`dirname $0`/resolv.conf-backup
        if [ -e "$RESOLV_CONF_BACKUP" ]; then
                echo "restore script at work!"
                grep '^#@VPNC_GENERATED@' /etc/resolv.conf > /dev/null 2>&1 && c
at "$RESOLV_CONF_BACKUP" > /etc/resolv.conf
                rm -f -- "$RESOLV_CONF_BACKUP"
                SCRIPT_DIR=`dirname $0`
                setprop net.dns1 `cat $SCRIPT_DIR/dns1.txt`
                setprop net.dns2 `cat $SCRIPT_DIR/dns2.txt`
                setprop net.dns.search `cat $SCRIPT_DIR/dnssearch.txt`
        fi
}

You will notice that I added setprop net.dns.search to the script. Now I can 
get to my internal sites!

Original comment by [email protected] on 13 May 2011 at 7:15

from get-a-robot-vpnc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.