f3507g-x201-usbnet (455B)
1 #!/bin/sh 2 3 CONTROL_DEVICE="/dev/ttyACM1" 4 APN="surfo2" 5 6 case "$1" in 7 -s) 8 echo -n "Starting usbnet connection..." 9 chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" \ 10 "AT*ENAP=1,1" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE 11 sleep 1 12 echo "done" 13 ;; 14 -k) 15 echo -n "Stopping usbnet connection..." 16 chat -v "" "AT*ENAP=0" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE 17 echo "done" 18 ;; 19 -r) 20 $0 -k 21 $0 -s 22 ;; 23 *) 24 echo "usage: $0 [-s|-k|-r]" 25 esac 26 exit 0 27