Trailblazer configuration awk script

John G. De Armond jgd at rsiatl.UUCP
Thu Nov 23 05:12:56 AEST 1989


In article <4268 at helios.ee.lbl.gov> leres at helios.ee.lbl.gov (Craig Leres) writes:
>Here's an awk script I wrote to munge the configuration output of my
>Trailblazer T2500's so that I could more easily restore a config (when
>doing rom upgrades, for example). My awk is vanilla SunOS 3.5.
>


Well, here's a KISS version of the same program using your friend and mine,
SED :-).

to use, simply fix the stty statement for the proper baud rate,
change the port name and uncomment, add or delete appropriate lines.

John

-----------------------

#set -xv

# Setup for Telebit with a getty

trap 'trap "" 1 2 3 9 15;
	rm -f /usr/spool/locks/LCK..tty01
exit 2' 1 2 3 15


if [ -f /usr/spool/locks/LCK..acu1 ]
then 
	echo "Port locked"
	exit	# can't do anything with the port locked
else
	touch /usr/spool/locks/LCK..acu1


	( stty 9600 ;

	cat <<EOF_HERE  |

~&F				# restore enhanced command mode defaults
~S63=1				# enhanced command mode
s0=1				# answer on 1 ring
s7=65				# wait time in seconds for carrier
q4				# do not send unsolicited result codes to DTE
e0				# do not echo commands back to DTE
s41=10				# modem inactivity timeout (6 min intervals)
s45=0				# remote access disabled
s50=0				# automatic speed determination
#s50=255			# speed is PEP tones
#s52=1				# no answer if dtr down.
s52=2				# no answer if dtr down. reset modem on dtr dow
s54=3				# pass break on to computer
#s55=3				# ignore +++ escape sequence
s55=0				# handle like hayes the +++ escape sequence
s66=1				# lock interface speed to s51
s58=2				# flow control is rts/cts to DTE
s68=2				# flow control is rts/cts to modem
s67=0				# CTS is used for flow control
#67=1				# assert cts 200 ms after rts
s64=1				# ignore data sent by local DTE when answering
s92=0				# answer the phone using s50 (pep first)
s94=1				# modems do speed negotiation
s110=255			# data compression enable iff remote s110=1
s111=30				# uucp protocol spoofing
#s111=255			# negotiate protocol spoofing
#s130=5				# assert dsr when valid data carrier detected
s130=0				# dsr is always on
#s130=3				# assert dsr when modem is ready is accept
#				# commands
s131=1				# assert dcd when valid data carrier detected
S51=4				# interface at 9600

&w0				# save setup to A

EOF_HERE

	sed -e '/^#/d' -e 's/#.*//' -e 's/[	 ]*$//g' -e '/^$/d' -e 's/^/AT/' -e 's/$/
	while read aline
	do
		echo $aline ;
		sleep 1 ;
	done
	) </dev/acu1 >/dev/acu1

	rm -f /usr/spool/locks/LCK..acu1
fi
exit

# ------ end of file ----

-- 
John De Armond, WD4OQC                     | Manual? ... What manual ?!? 
Radiation Systems, Inc.     Atlanta, GA    | This is Unix, My son, You 
emory!rsiatl!jgd          **I am the NRA** | just GOTTA Know!!! 



More information about the Alt.sources.d mailing list