#!/bin/sh while [ true ] do InterFace=`ifconfig | grep -o "ppp0"` if [ "$InterFace" == "ppp0" ]; then if [ ! -f "/etc/resolv.conf.org" ]; then # route del default &>/dev/null route add default dev $InterFace &>/dev/null route add dev $InterFace &>/dev/null if [ -f "/etc/ppp/resolv.conf" ]; then cp /etc/resolv.conf /etc/resolv.conf.org &>/dev/null cat /etc/ppp/resolv.conf >> /etc/resolv.conf rm /etc/ppp/resolv.conf &>/dev/null fi fi sleep 300 else if [ -f "/etc/resolv.conf.org" ]; then rm /etc/resolv.conf &>/dev/null mv /etc/resolv.conf.org /etc/resolv.conf &>/dev/null fi rm /etc/ppp/resolv.conf &>/dev/null killall pppd &>/dev/null sleep 2 /root/ppp/pppd $1 115200 mtu 1450 mru 1450 debug noipdefault persist nodeflate nodetach usepeerdns connect /root/ppp/ppp-on-dialer & sleep 30 fi done exit 0