Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- DIALTIMEOUT=20
- MODEM=ttyUSB2 SPEED=9600 MODEM_INIT='AT+CGDCONT=1,\"IP\",\"internet.mts.ru\" OK'
- IH_IP=" ipcp-accept-local ipcp-accept-remote noipdefault
- debug usepeerdns user mts noauth mtu 576
- novj nobsdcomp novjccomp nopcomp noaccomp lcp-echo-interval 0.5"
- LOGSCRIPT="CONNECT"
- PHONE="*99***1#"
- DR=`route -n | egrep '^0.0.0.0'| grep -v ppp | sed 's/^[^ ]* *\([^ ]*\) .*/default gw \1/'` ;
- if [ -n "$DR" ] ; then
- trap "echo route add $DR ; route add $DR ; exit" 2 3 9 15
- route delete $DR
- echo route delete $DR
- fi
- while true ; do
- pppd \
- connect 'chat -v ABORT "NO DIALTONE" ABORT "NO CARRIER" ABORT BUSY "" '"$MODEM_INIT"' ATDP'$PHONE' '"$LOGSCRIPT"' ;' \
- crtscts defaultroute modem -detach mru 1500 \
- $NASH_IP:$IH_IP /dev/$MODEM $SPEED
- cat /etc/ppp/resolv.conf > /etc/resolv.conf
- sleep $DIALTIMEOUT
- done
Advertisement
Add Comment
Please, Sign In to add comment