comgt: Add scripts to comgt to retrieve the IMSI and CNUM to identify the SIM card.
[openwrt/svn-archive/archive.git] / package / comgt / files / getimsi.gcom
diff --git a/package/comgt/files/getimsi.gcom b/package/comgt/files/getimsi.gcom
new file mode 100644 (file)
index 0000000..0485456
--- /dev/null
@@ -0,0 +1,17 @@
+opengt
+ set com 115200n81
+ set comecho off
+ set senddelay 0.02
+ waitquiet 0.2 0.2
+ flash 0.1
+
+:start
+ send "AT+CIMI^m"
+ get 1 "^m" $s
+ get 1 "^m" $s
+ let x = len($s)
+ if x<2 goto continue
+ let $s = $right($s, x-1)
+ print $s
+:continue
+ exit 0