Open GoogleCodeExporter opened 9 years ago
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 a432...@gmail.com
on 13 May 2011 at 7:15
Original issue reported on code.google.com by
a432...@gmail.com
on 12 May 2011 at 11:06