#!/bin/sh # Company: PowerCraft Technology # Author: Copyright Jelle de Jong # Note: Please send me an email if you enhanced the script # Version: 0.0.4 # Date: 2008-03-31 / 2008-12-12 / 2009-04-04 / 2009-06-03 # System: Ubuntu/Debian GNU/Linux # Description: Closing HSDPA USB Huawei E220/E156G/E180 monitoring # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more de/usr/bin/tails. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # The following iformation is based on the information found in: # Remove the pin from the sim with a normal mobile phone # /media/20071107_130928/apn.xml # When using a vodafone data simcard use "office.vodafone.nl" # When using a vodafone prepaid simcard use "live.vodafone.com" # set -x # exec 2>/var/log/pct-mobile-internet-init.log sudo /etc/init.d/networking stop && sleep 3 [ -e /etc/network/interfaces ] && [ ! -e /etc/network/interfaces.huawei.backup ] && sudo mv --verbose /etc/network/interfaces /etc/network/interfaces.huawei.backup [ -e /etc/network/interfaces ] && sudo mv --verbose /etc/network/interfaces /etc/network/interfaces.backup echo "vodafone * vodafone" | sudo tee /etc/ppp/pap-secrets echo "vodafone * vodafone" | sudo tee /etc/ppp/chap-secrets echo 'TIMEOUT 3 ABORT "BUSY" ABORT "NO CARRIER" ABORT "VOICE" ABORT "NO DIALTONE" ABORT "NO DIAL TONE" ABORT "NO ANSWER" ABORT DELAYED "" ATZ OK ATQ0&FEV1X1S0=0&C1&D2 OK AT+CGDCONT=16,"IP","live.vodafone.com" OK ATDT*99***16# CONNECT ""' | sudo tee /etc/chatscripts/pct-mobile-internet.chat #~ echo '/dev/ttyUSB0 #~ 7200000 #~ user vodafone #~ connect "/usr/sbin/chat -v -f /etc/chatscripts/pct-mobile-internet.chat" #~ noccp #~ noauth #~ noipdefault #~ usepeerdns #~ defaultroute replacedefaultroute' | sudo tee /etc/ppp/peers/pct-mobile-internet echo '/dev/ttyUSB0 7200000 user vodafone connect "/usr/sbin/chat -v -f /etc/chatscripts/pct-mobile-internet.chat" #lock crtscts #modem noauth #usepeerdns noipdefault noccp #nobsdcomp #novj defaultroute replacedefaultroute' | sudo tee /etc/ppp/peers/pct-mobile-internet echo auto lo | sudo tee -a /etc/network/interfaces echo iface lo inet loopback | sudo tee -a /etc/network/interfaces echo | sudo tee -a /etc/network/interfaces echo auto ppp0 | sudo tee -a /etc/network/interfaces echo iface ppp0 inet ppp | sudo tee -a /etc/network/interfaces echo provider pct-mobile-internet | sudo tee -a /etc/network/interfaces echo pre-up /usr/share/pct-mobile-internet/pct-mobile-internet-detect | sudo tee -a /etc/network/interfaces echo up /usr/share/pct-mobile-internet/pct-mobile-internet-monitor | sudo tee -a /etc/network/interfaces echo pre-down /usr/share/pct-mobile-internet/pct-mobile-internet-close | sudo tee -a /etc/network/interfaces echo | sudo tee -a /etc/network/interfaces echo nameserver 62.140.138.237 | sudo tee -a /etc/resolv.conf echo nameserver 62.140.140.250 | sudo tee -a /etc/resolv.conf echo | sudo tee -a /etc/resolv.conf sudo /etc/init.d/networking start exit ------------------------------------------------------------------------ sudo /etc/init.d/sysklogd start sudo /etc/init.d/klogd start sudo tail -f -n 1000 /var/log/syslog sudo pppd call pct-mobile-internet sudo poff pct-mobile-internet sudo iftop -i -B ppp0 sudo ps aux | grep ppp /usr/bin/screen -d -m -S ppp-monitor /usr/bin/bwm-ng --interfaces ppp0 --output curses --unit bytes --type sum --timeout 1000 screen -x ppp-monitorig -X close ------------------------------------------------------------------------ udevinfo -a -p /class/tty/ttyUSB0 echo 'KERNEL=="ttyUSB0", ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/usr/bin/pct-mobile-internet-enable"' | sudo tee /etc/udev/rules.d/z60_pct-mobile-internet.rules echo 'KERNEL=="ttyUSB0", ACTION=="remove", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/usr/bin/pct-mobile-internet-disable"' | sudo tee --append /etc/udev/rules.d/z60_pct-mobile-internet.rules sudo chmod 644 /etc/udev/rules.d/z60_pct-mobile-internet.rules http://www.freebsd.org/doc/en/books/handbook/ppp.html http://www.yolinux.com/HOWTO/PPP-HOWTO.html http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=445711 https://help.ubuntu.com/community/BluetoothDialup http://thinkleft.com.au/3_MobileBroadband_APN_and_PPP sudo rmmod option sudo rmmod usbserial sudo modprobe usbserial vendor=0x12d1 product=0x1003 sudo /etc/init.d/networking stop sudo wvdial --no-syslog --config $HOME/.wvdial.conf auto lo eth0 allow-hotplug eth0 iface eth0 inet dhcp iface lo inet loopback ------------------------------------------------------------------------