/etc/comgt/operator is in comgt 0.32-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | ############################################################################
# operator - a comgt script for viewing and selecting networks
#
# An example of how you might do operator selection when travelling
# in a foreign country.
# Big ToDo - improve the interface!!!
#
# Copyright (C) 2003 Paul Hardwick <paul@peck.org>
#
# 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 2 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 details.
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
###########################################################################
############################################################################
# $Id: operator,v 1.1 2006/10/20 14:19:54 pharscape Exp $
# $Log: operator,v $
# Revision 1.1 2006/10/20 14:19:54 pharscape
# Added scripts directory - expected operational location will /etc/comgt/
#
# Revision 1.1.1.1 2006/08/16 21:21:31 pharscape
# intial CVS import
#
############################################################################
opengt
set com 115200n81
set senddelay 0.05
waitquiet 2 0.5
:operator
send "AT+COPS=?^m"
waitfor 20 "+COPS=?","Error"
if % = -1 goto timeout
if % = 0 goto getlist
print "Error response from device\n"
exit 1
:getlist
let c=0
print "Getting Operator list: "
:waiting
print "."
get 2 "^m" $s
if % = -1 goto stillwaiting
waitquiet 1 0.2
print "\n"
print $s,"\n\n==============================================================\n"
print "Format: (Access,Long Name, Short Name, Network ID [,Technology])\n"
print "Access: 2 - Registered, 1 - Available, 3 - Forbidden\n"
print "Technology: 0 - GSM/GPRS, 2 - UMTS (Not available on all cards)\n"
print "\nEnter the Network ID to attempt manual registration\n [blank = automatic selection]:"
input $a
let a=len($a)
dec a
let $a=$left($a,a)
if $a = "" goto automatic
let $b="AT+COPS=1,2,\""+$a
let $b=$b+"\"^m"
send $b
goto waitresult
:automatic
let $b="AT+COPS=0^m"
send $b
:waitresult
waitfor 60 "OK","ERR"
if % = -1 goto timeout
if % = 2 goto failedreg
print "Registration request accepted\n"
print "Command was: ",$b,"\n"
exit 0
:failedreg
print "Registration request refused\n"
print "Command was: ",$b,"\n"
exit 1
:stillwaiting
if c > 60 goto timeout
let c=c+1
goto waiting
:timeout
print "Network Search Timeout\n"
exit 1
|