8 proto_3g_init_config
() {
11 ppp_generic_init_config
12 proto_config_add_string
"device"
13 proto_config_add_string
"apn"
14 proto_config_add_string
"service"
15 proto_config_add_int
"pincode"
22 json_get_var device device
24 json_get_var service service
25 json_get_var pincode pincode
28 proto_set_available
"$interface" 0
34 chat
="/etc/chatscripts/evdo.chat"
37 chat
="/etc/chatscripts/3g.chat"
38 cardinfo
=$
(gcom
-d "$device" -s /etc
/gcom
/getcardinfo.gcom
)
39 if echo "$cardinfo" |
grep -q Novatel
; then
45 export MODE
="AT\$NWRAT=${CODE},2"
46 elif echo "$cardinfo" |
grep -q Option
; then
52 export MODE
="AT_OPSYS=${CODE}"
55 if [ -n "$pincode" ]; then
56 PINCODE
="$pincode" gcom
-d "$device" -s /etc
/gcom
/setpin.gcom ||
{
57 proto_notify_error
"$interface" PIN_FAILED
58 proto_block_restart
"$interface"
62 [ -n "$MODE" ] && gcom
-d "$device" -s /etc
/gcom
/setmode.gcom
66 connect
="${apn:+USE_APN=$apn }/usr/sbin/chat -t5 -v -E -f $chat"
67 ppp_generic_setup
"$interface" \
80 proto_kill_command
"$interface"