Guest User

Untitled

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