2 grep WRT54G3G
/proc
/diag
/model
>/dev
/null ||
return 0
3 echo "$1" > /proc
/diag
/led
/3g_green
4 echo "$2" > /proc
/diag
/led
/3g_blue
5 echo "$3" > /proc
/diag
/led
/3g_blink
12 config_get device
"$1" device
14 # try to figure out the device if it's invalid
15 [ -n "$device" -a -e "$device" ] ||
{
16 for device
in /dev
/ttyUSB2
/dev
/tts
/2 /dev
/usb
/tts
/0 /dev
/noz0
; do
18 config_set
"$1" device
"$device"
24 # enable 3G with the 3G button by default
25 config_get button
"$1" button
27 config_set
"$1" button
1
33 killall gcom
>/dev
/null
2>/dev
/null
36 setup_interface_3g
() {
40 config_get device
"$config" device
42 for module
in slhc ppp_generic ppp_async
; do
43 /sbin
/insmod
$module 2>&- >&-
46 config_get apn
"$cfg" apn
47 config_get service
"$cfg" service
48 config_get pincode
"$cfg" pincode
49 config_get mtu
"$cfg" mtu
53 # figure out hardware specific commands for the card
54 if gcom
-d "$device" -s /etc
/gcom
/getcardinfo.gcom |
grep Novatel
2>/dev
/null
>/dev
/null
; then
60 mode
="AT\$NWRAT=${CODE},2"
67 mode
="AT_OPSYS=${CODE}"
70 PINCODE
="$pincode" gcom
-d "$device" -s /etc
/gcom
/setpin.gcom ||
{
71 echo "$cfg(3g): Failed to set the PIN code."
75 MODE
="$mode" gcom
-d "$device" -s /etc
/gcom
/setmode.gcom
78 start_pppd
"$config" \
86 connect
"USE_APN=\"$apn\" /etc/ppp/3g.connect" \
87 ${mtu:+mtu $mtu mru $mtu} \