6ba061ff980b30c5a6881407a9abda50cd168675
[openwrt.git] / package / network / utils / comgt / files / runcommand.gcom
1 # run AT-command from environment
2 opengt
3  set com 115200n81
4  set senddelay 0.02
5  waitquiet 1 0.2
6  flash 0.1
7
8 :start
9  send "sending -> "
10  send $env("COMMAND")
11  send "^n"
12
13  waitfor 15 "OK","ERR","ERROR"
14  if % = 0 goto continue
15  if % = 1 goto error
16  if % = 2 goto error
17
18  print "Timeout running AT-command\n"
19  exit 1
20
21 :error
22  print "Error running AT-command\n"
23  exit 1
24
25 :continue
26  exit 0