#!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin ETC="/etc" RUNDIR="/var/cache/pppconfig" TEMPRESOLV="/tmp/resolv.conf" RESOLVCONF="$ETC/resolv.conf" RESOLVBAK="$ETC/resolv.gsm" PPP_IFACE=$(ifconfig |grep ppp0) PPP_IFACE=${PPP_IFACE%% *} DNS1="208.67.222.222" DNS2="208.67.220.220" if [ $PPP_IFACE = "ppp0" ]; then if [ -d /etc/resolvconf/run/interface ]; then echo "nameserver $DNS1" > /etc/resolvconf/run/interface/ppp0 echo "nameserver $DNS2" >> /etc/resolvconf/run/interface/ppp0 /etc/init.d/resolvconf reload else echo "nameserver $DNS1" > "$TEMPRESOLV" || exit 1 echo "nameserver $DNS2" >> "$TEMPRESOLV" || exit 1 # Back up resolv.conf. Follow symlinks. Keep TEMPRESOLV # around for 0dns-down to look at. /bin/mv "$RESOLVCONF" "$RESOLVBAK" || exit 1 sleep 10 /bin/mv "$TEMPRESOLV" "$RESOLVCONF" || exit 1 chmod 644 "$RESOLVCONF" || exit 1 fi fi