home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume32
/
ecu
/
part40
< prev
next >
Wrap
Text File
|
1992-09-15
|
53KB
|
1,827 lines
Newsgroups: comp.sources.misc
From: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
Subject: v32i075: ecu - ECU Asynchronous Communications v3.20, Part40/40
Message-ID: <1992Sep15.154003.21537@sparky.imd.sterling.com>
X-Md4-Signature: 76180b4d8081227dd33ffe40d1a312a2
Date: Tue, 15 Sep 1992 15:40:03 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
Posting-number: Volume 32, Issue 75
Archive-name: ecu/part40
Environment: SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses
Supersedes: ecu: Volume 21, Issue 53-89
---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is ecu320.40 (part 40 of ecu320)
# do not concatenate these parts, unpack them in order with /bin/sh
# file models/keys continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 40; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping models/keys'
else
echo 'x - continuing file models/keys'
sed 's/^X//' << 'SHAR_EOF' >> 'models/keys' &&
X F1:F1:esc O q
X F2:F2:esc O r
X F3:F3:esc O s
X F4:F4:esc O t
X F5:F5:esc O u
X F6:F6:esc O v
X F7:F7:esc O w
X F8:status:dc4
X F9:no status:nl
X F10:redisp:esc O y
X F11:redisp:syn
X PGDN:cancel:esc O Q
X END:enter:esc O M
X PGUP:dispform:esc O R
X CUU:^:dle
X CUD:v:so
X CUL:<:stx
X CUR:>:ack
X
Xremecu
X F1:Home:0xC8
X F2:End:0xC6
SHAR_EOF
echo 'File models/keys is complete' &&
chmod 0644 models/keys ||
echo 'restore of models/keys failed'
Wc_c="`wc -c < 'models/keys'`"
test 322 -eq "$Wc_c" ||
echo 'models/keys: original size 322, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/lookfortest.ep ==============
if test -f 'models/lookfortest.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/lookfortest.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/lookfortest.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/lookfortest.ep' &&
X# CHK=0xFA5C
X# lookfor_test.ep (needs a modem already attached)
X
X send 'ate0q1'
X nap 20
X flush
X
X send 'at'
X
X lookfor 'OK'
X ifi $i0 == 1 echo '... got false success'; return
X ifi $i0 <> 0 echo '... got illogical result';set $i0;return
X echo '... got good result for failure to read'
X
X send 'ate1q0'
X
X lookfor -e 'OK'+%chr(0x0D)+%chr(0x0A) 20
X ifi $i0 == 0 echo '... got false failure'; return
X ifi $i0 <> 1 echo '... got illogical result';set $i0;return
X echo '... got good result for read'
X
X
X
X# vi: set tabstop=8:
SHAR_EOF
chmod 0644 models/lookfortest.ep ||
echo 'restore of models/lookfortest.ep failed'
Wc_c="`wc -c < 'models/lookfortest.ep'`"
test 515 -eq "$Wc_c" ||
echo 'models/lookfortest.ep: original size 515, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/mhack_test.ep ==============
if test -f 'models/mhack_test.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/mhack_test.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/mhack_test.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/mhack_test.ep' &&
X# CHK=0xEC1B
X#---------------------------------------------------------------------------
X# mhack_test.ep - test %mhack while showing entertaining colors
X# also useful to get a feeling for how fast the procedure language can be
X#---------------------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:03-16-1990-05:25-wht@n4hgf-requires ecu x2.64 or later
X
X echo 'SIGINT to quit\n'
X $i20 = %colors
X $i21 = %colors & 0xFFFFF0FF
X whilei 1==1
X {
X $i0 = %mhack
X $i1 = $i0 & 0xF00
X icolor $i21 | $i1
X echo -n %itos($i0,8d)+%chr(0x0d)
X }
X echo ''
X icolor $i20
X
SHAR_EOF
chmod 0644 models/mhack_test.ep ||
echo 'restore of models/mhack_test.ep failed'
Wc_c="`wc -c < 'models/mhack_test.ep'`"
test 677 -eq "$Wc_c" ||
echo 'models/mhack_test.ep: original size 677, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/mkdir.ep ==============
if test -f 'models/mkdir.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/mkdir.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/mkdir.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/mkdir.ep' &&
X# CHK=0x91D9
X system 'mkdir '+%argv(1)
SHAR_EOF
chmod 0644 models/mkdir.ep ||
echo 'restore of models/mkdir.ep failed'
Wc_c="`wc -c < 'models/mkdir.ep'`"
test 40 -eq "$Wc_c" ||
echo 'models/mkdir.ep: original size 40, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/oneline.ep ==============
if test -f 'models/oneline.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/oneline.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/oneline.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/oneline.ep' &&
X# CHK=0xF093
X#--------------------------------------------------------------
X# oneline.ep
X#
X# send command in $s0, expecting a one line response
X# and a csh prompt ending in '% '
X#
X# returns: $s0 = one line response in $s0 if success
X# $i0 = 1 if success, else 0
X#--------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-25-1989-13:56-wht-new do command syntax
X#:06-25-1989-12:33-wht-new if/while syntax
X#:06-22-1989-13:30-wht-creation
X
X mkvar $icsave; $icsave = %colors
X color gray
X send $s0 # send command
X lookfor -e %chr(0x0A) 50 # scan command echo
X ifi $i0 == 0 icolor $i2;return # if not found, return
X lgets -e $s0 500 5 '\n' # get one line response
X lookfor '% ' 50 # get prompt, don't echo
X # $i0 = 1 if prompt, else 0
X icolor $icsave
SHAR_EOF
chmod 0644 models/oneline.ep ||
echo 'restore of models/oneline.ep failed'
Wc_c="`wc -c < 'models/oneline.ep'`"
test 974 -eq "$Wc_c" ||
echo 'models/oneline.ep: original size 974, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/opuslogin.ep ==============
if test -f 'models/opuslogin.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/opuslogin.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/opuslogin.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/opuslogin.ep' &&
X# CHK=0xE753
X#+-----------------------------------------------------------------
X# opuslogin.ep - ecu OPUS BBS login procedure
X# wht%n4hgf@gatech.edu
X#
X# %argv(1) = remote name
X# %argv(2) = first name
X# %argv(3) = last name
X# %argv(4) = password
X#+-----------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:05-10-1992-09:22-wht@n4hgf-%conn can be -1 now
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-25-1989-13:56-wht-new do command syntax
X#:06-25-1989-12:33-wht-new if/while syntax
X#:06-23-1989-19:46-wht-improved hayes dialer reduces need to report dial fail
X#:06-19-1989-22:50-wht-use while and if statements
X#:06-14-1989-15:58-wht-add login capability when already connected
X#:06-11-1989-23:37-wht-creation
X
X mkvar $i_csave,$i_ltimeout,$i_retries
X
X $i_csave = %colors
X $i_retries=3
X
X color red; echo -n '\nauto-logon to '
X color yellow; echo -n %argv(1)
X color red; echo ' on '+%date+' at '+%time+'\n'
X
X ifi %argc != 5 # not enough args
X {
X color red
X echo %argv(0)+' needs 5 arguments (got '+%itos(%argc)+')'
X goto SORRY1
X }
X
X ifi %conn <= 0 goto DIAL
X
X ifs %rname == %argv(1)
X {
X color brown; echo -n 'already connected to '
X color yellow; echo %rname
X goto GET_LOGIN_PROMPT_RETRY
X }
X
XHANGUP
X ifi %conn <> 0 echo 'hanging up on '+%rname; hangup
X
XDIAL
X color green
X dial %argv(1); set $i1=$i0 #save dial result in $i1
X ifi $i1 == 2 color red; echo 'interrupted'; goto SORRY
X ifi $i1 != 0 goto SORRY
X
XTEST_MODEM_RESULT
X ifs $s0 != 'CONNECT '+%itos(%baud)
X color yellow; echo 'baud rate mismatch ... retrying'; goto HANGUP
X
X# give name to remote
X lookfor -e 'FIRST name: ' 150
X send %argv(2)
X lookfor -e 'LAST name: ' 150
X send %argv(3)
X
X lookfor -e '[Y,n]? ' 40
X send 'Y'
X
X lookfor -e 'Password: ' 80
X send %argv(4)
X lookfor -e '\n'
X set $i0=0
X goto SETCOLOR_AND_RETURN_STATUS
X
X# procedure failed
XSORRY
X echo ''
X color red
X echo '....... sorry'
X set $i0=0
X goto SETCOLOR_AND_RETURN_STATUS
X
XSORRY1
X echo ''
X color red
X echo '....... sorry'
X set $i0=1
X
XSETCOLOR_AND_RETURN_STATUS
X icolor $i_csave
X return $i0
X
X# vi:set tabstop=4 shiftwidth=4:
SHAR_EOF
chmod 0644 models/opuslogin.ep ||
echo 'restore of models/opuslogin.ep failed'
Wc_c="`wc -c < 'models/opuslogin.ep'`"
test 2232 -eq "$Wc_c" ||
echo 'models/opuslogin.ep: original size 2232, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/p.ep ==============
if test -f 'models/p.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/p.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/p.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/p.ep' &&
X# CHK=0x8848
X#+---------------------------------------------------------
X# p.eq - colorful, selective ps -aux on remote BSD system
X#----------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-30-1989-18:53-wht-creation
X
X mkvar $icolor; $icolor = %colors
X mkvar $itimeout; $itimeout = 50
X send 'ps -aux'
X lookfor '\n' 40
X $s0 = ''
X whilei 1==1
X {
X lgets $s00 $itimeout 5 '\n'
X ifi $i0 == 0 continue
X $itimeout = 20
X ifi %instr($s0,'% ') >= 0 break # prompt ends it
X color cyan
X ifi %instr($s0,'getty') >= 0 continue
X ifi %instr($s0,'/etc') >= 0 continue
X ifi %instr($s0,'rlogin') >= 0 continue
X ifi %instr($s0,'biod') >= 0 continue
X ifi %instr($s0,'csh') >= 0 continue
X ifi %instr($s0,'/usr/lib') >= 0 continue
X ifi %instr($s0,' i29 ') > 0 color green
X ifi %instr($s0,' i13 ') > 0 color red
X ifi %instr($s0,'cma') == 0 color yellow
X ifi %instr($s0,'gfp') == 0 color lt_blue
X ifi %instr($s0,'jts') == 0 color lt_blue
X ifi %instr($s0,'UUCP') >= 0 color red
X ifi %instr($s0,'uu') >= 0 color red
X echo $s0
X }
X icolor $icolor
X send ''
X
SHAR_EOF
chmod 0644 models/p.ep ||
echo 'restore of models/p.ep failed'
Wc_c="`wc -c < 'models/p.ep'`"
test 1207 -eq "$Wc_c" ||
echo 'models/p.ep: original size 1207, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/phone ==============
if test -f 'models/phone' -a X"$1" != X"-c"; then
echo 'x - skipping models/phone (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/phone (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/phone' &&
X#ECUPHONE
X# when saving this file, ECU will preserve commented lines
X#sco2:1(408)425-3502::2400:N:sosco uucp
Xnavobs:1(202)653-0351::1200:N:Naval Observatory Time
SHAR_EOF
chmod 0644 models/phone ||
echo 'restore of models/phone failed'
Wc_c="`wc -c < 'models/phone'`"
test 162 -eq "$Wc_c" ||
echo 'models/phone: original size 162, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/phrases ==============
if test -f 'models/phrases' -a X"$1" != X"-c"; then
echo 'x - skipping models/phrases (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/phrases (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/phrases' &&
Xstty:stty intr ^C kill ^U erase ^H^r
Xmail-csh:mail emory\!tridom\!n4hgf\!wht^r
Xmail-sh:mail emory!tridom!n4hgf!wht^r
SHAR_EOF
chmod 0644 models/phrases ||
echo 'restore of models/phrases failed'
Wc_c="`wc -c < 'models/phrases'`"
test 117 -eq "$Wc_c" ||
echo 'models/phrases: original size 117, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/ps.ep ==============
if test -f 'models/ps.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/ps.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/ps.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/ps.ep' &&
X# CHK=0xDA50
X#+------------------------------------------------------
X# ps.eq - another colorful ps example
X#-------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-30-1989-18:53-wht-creation
X
X mkvar $icolor; $icolor = %colors
X send %argv(0)+' '+%argv(1)+' '+%argv(2)
X lookfor '\n' 40
X $s0 = ''
X whilei 1==1
X {
X lgets $s0 60 60 '\n'
X color cyan
X ifi %instr($s0,'(getty)' >= 0 continue
X else ifi %instr($s0,'(tcsh)' >= 0 continue
X else ifi %instr($s0,'(csh)' >= 0 continue
X else ifi %instr($s0,'(sh)' >= 0 continue
X else ifi %instr($s0,'/etc/init' >= 0 continue
X else ifi %instr($s0,'% ') >= 0 break
X else ifi %instr($s0,'USER') == 0 color gray
X else ifi %instr($s0,' i29 ') > 0 color red
X else ifi %instr($s0,' i13 ') > 0 color green
X else ifi %instr($s0,'root') == 0 color yellow
X echo $s0
X }
X icolor $icolor
X send ''
X
SHAR_EOF
chmod 0644 models/ps.ep ||
echo 'restore of models/ps.ep failed'
Wc_c="`wc -c < 'models/ps.ep'`"
test 992 -eq "$Wc_c" ||
echo 'models/ps.ep: original size 992, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/put_ecu.ep ==============
if test -f 'models/put_ecu.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/put_ecu.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/put_ecu.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/put_ecu.ep' &&
X# CHK=0x6289
X#--------------------------------------------------------------
X# put_ecu.ep - update remote copy of ecu sources
X#--------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-25-1989-14:28-wht-use rz_update
X
X $s10 = %rname
X ifi %instr($s10,'tridom') == 0
X $s10 = 'tridom'
X
X ifs $s10 == 'tridom'
X {
X $s0 = '/u3/sd/wht/src/ecu'
X $s1 = '/u1/src/ecu'
X $s2 = '`ff \'*.c\' \'*.h\' Makefile \'*.ep\' \'.mi\' \'*.txt\' \'*.man\'` xsel386/*'
X $s3 = 'wht'
X goto CALL_SZ_UPDATE
X }
X else ifs $s10== 'ki4xo'
X {
X $s0 = '/user/wht/src/ecu'
X $s1 = '/u1/src/ecu'
X $s2 = '{.,z}/{Makefile,*.{c,h}} `ff \'*.ep\' \'.mi\' \'*.man\'` xsel386/*'
X $s3 = 'wht'
X goto CALL_SZ_UPDATE
X }
X else ifs $s10== 'coke-jsm'
X {
X $i39=%colors
X color red; echo '\n\nHAVE YOU MADE A NO-SELECT VERSION???????\n\n'
X mkvar $s_rpwd(20)
X echo -n 'root password? ' ; $s_rpwd = %cgets
X icolor $i39
X $s0 = '/usr/wht/bin'
X $s1 = '/u1/src/ecu'
X $s2 = 'ecu'
X $s3 = 'wht'
X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
X lookfor '% ' 40
X $s0 = '/usr/wht/bin'
X $s1 = '/usr/wht/bin'
X $s2 = 'ecusz ecurz ecusea'
X $s3 = 'wht'
X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
X lookfor '% ' 40
X $s0 = '/usr/wht'
X $s1 = '/u1/src/ecu/doc'
X $s2 = '*.man'
X $s3 = 'wht'
X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
X lookfor '% ' 40
X $s0 = '/usr/wht/.ecu'
X $s1 = '/u1/src/ecu/models'
X $s2 = '*'
X $s3 = 'wht'
X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
X lookfor '% ' 40
X $s0 = '/usr/lib/ecu'
X $s1 = $s0
X $s2 = '*'
X $s3 = ''
X do 'su-csh' 'root' $s_rpwd
X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
X send -e 'chmod u+s /usr/lib/ecu/ecuungetty'
X send %chr(0x04)
X return
X }
X else echo 'not to '+$s10+' you don\'t'
X
X# $s0 = remote directory
X# $s1 = local directory
X# $s2 = file list
X# $s3 = necessary username on remote system
XCALL_SZ_UPDATE
X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
SHAR_EOF
chmod 0644 models/put_ecu.ep ||
echo 'restore of models/put_ecu.ep failed'
Wc_c="`wc -c < 'models/put_ecu.ep'`"
test 2060 -eq "$Wc_c" ||
echo 'models/put_ecu.ep: original size 2060, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/ringcount.ep ==============
if test -f 'models/ringcount.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/ringcount.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/ringcount.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/ringcount.ep' &&
X#+----------------------------------------------------------------
X# ringcount.ep - ESIO Ring Indicator Test
X# only useful for versions compiled for and using ESIO tty driver
X#-----------------------------------------------------------------
X
X $i_initial_RI = %ridet # initial number of rings
X
X send 'aaaaaaaats0=0'
X lookfor -e %chr(0x01) 30
X
X whilei 1==1
X {
X echo -n 'RI= '+%itos(%ridet,5d)+' MSR='+%msrtext
X eeol
X echo -n '\r'
X nap -m 100
X }
SHAR_EOF
chmod 0644 models/ringcount.ep ||
echo 'restore of models/ringcount.ep failed'
Wc_c="`wc -c < 'models/ringcount.ep'`"
test 449 -eq "$Wc_c" ||
echo 'models/ringcount.ep: original size 449, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/root.ep ==============
if test -f 'models/root.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/root.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/root.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/root.ep' &&
X# CHK=0x067D
X#+----------------------------------------------
X# su-root.ep
X#-----------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-27-1989-17:02-wht-working
X
X mkvar icsave;$icsave = %colors
X color lt_blue black
X echo -n 'remote root password? '
X color black black
X $s0 = %cgets
X icolor $icsave
X do 'su' 'root' $s0
X $s0 = '' # forget password
X lookfor '% ' 100 # swallow prompt
X send 'source ~wht/.cshrc'
SHAR_EOF
chmod 0644 models/root.ep ||
echo 'restore of models/root.ep failed'
Wc_c="`wc -c < 'models/root.ep'`"
test 600 -eq "$Wc_c" ||
echo 'models/root.ep: original size 600, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/rz_update.ep ==============
if test -f 'models/rz_update.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/rz_update.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/rz_update.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/rz_update.ep' &&
X# CHK=0x3514
X#--------------------------------------------------------------
X# rz_update.ep - update local directory
X#
X# parameters:
X# %argv(1) = remote directory to copy from
X# %argv(2) = local directory to copy to
X# %argv(3) = file list to get
X# %argv(4) = remote username needed, if any, else null
X# if %argv(4) not null, 'su_'+%argv(4)+".ep" must
X# exist to su to remote
X# %argv(5) name of superior procedure
X#
X#--------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:05-10-1992-09:22-wht@n4hgf-%conn can be -1 now
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-25-1989-13:56-wht-new do command syntax
X#:06-25-1989-12:33-wht-new if/while syntax
X#:06-22-1989-13:30-wht-creation
X
X# variable usage
X mkvar $i_csave # color settings at entry to procedure
X mkvar $i_rtnval # return code
X mkvar $i_suflag # true if su occurred
X mkvar $s_origdir(128) # original working directory
X mkvar $s_rdir(128) # remote directory we started with
X mkvar $s_ruser(16) # remote username we started with before su
X mkvar $s_xtitle(64) # title for xfer
X
X $i_csave=%colors # get colors at entry
X
X $s_xtitle = 'Connected to '+%rname
X ifs %argv(5) != ''
X $s_xtitle = $s_xtitle+' - procedure '+%argv(5)
X
X# check to make sure we are connected
X ifi %conn <= 0
X {
X color red; echo 'not connected to anyone!'
X goto SORRY
X }
X color lt_blue; echo 'Connected to '+%rname
X
X# save local current directory and change to target
X $s_origdir=%dir
X color brown
X ifs $s_origdir == %argv(2)
X echo -n 'local directory already '
X else
X {
X cd %argv(2)
X echo -n 'local directory set to '
X }
X color yellow; echo %dir
X
X# make sure remote username ok
X ifs %argv(4) == '' goto REMOTE_CD # if any remote username
X do 'bsd_uname' # get $s0=username
X ifi $i0 == 0 goto SORRY # test failure
X $s_ruser = $s0 # save original remote username
X ifs $s0 != %argv(4)
X { # need to su
X color brown
X echo -n 'remote username '
X color yellow
X echo -n $s0
X color brown
X echo ' ... su to '+%argv(4)+' now'
X color gray
X do 'su_'+%argv(4) # call proc, which calls su.ep
X lookfor '% ' 50 # su leaves prompt in buffer: swallow
X do 'bsd_uname' # make sure we su'd
X ifi $i0 == 0 goto SORRY
X ifs $s0 != %argv(4) # failed to su?
X {
X color red;echo 'su to '+%argv(4)+' failed'
X goto SORRY
X }
X $i_suflag = 1 # remember we su'd
X } # now we are proper username on remote
X
X# establish proper remote working directory
XREMOTE_CD
X color gray
X $s0 = 'pwd';do 'oneline' # save old remote ...
X $s_rdir = $s0 # ... directory in $s_rdir
X ifs $s_rdir != %argv(1) # if cd needed, do it
X {
X send 'cd '+%argv(1) # remote cd
X lookfor -e '\n' 50 # echo command
X lookfor '% ' 50 # swallow prompt
X $s0 = 'pwd'
X do 'oneline' # make sure we got there
X ifs $s0 != %argv(1) # dir change failed
X {
X color red;echo 'remote cd failed'
X goto SORRY;
X }
X }
X color brown; echo -n 'remote directory '
X color yellow; echo -n %argv(1)
X color brown; echo ' ... starting transfer now'
X
X# transfer files
X color lt_blue
X send 'sz -n -f '+%argv(3)
X lookfor -e '\n' 50 # echo remote command
X ifi $i0 == 0 # command failed?
X {
X color red; echo 'sz command failed or garbled echo'
X goto SORRY
X }
X color brown
X echo 'waiting for sz to start'
X nap 10
X color gray
X# $s5 = '**'+%chr(0x18)+'B' # ZMODEM header
X lgets $s0 150 10 '\n' # wait 15 secs for start
X ifi %instr($s0,'rz') < 0 # check for 'rz' startup from remote
X {
X color white;
X echo '\n'+$s0+'\n'
X color red
X echo 'sz protocol failure or trigger garbled'
X goto SORRY
X }
X icolor $i_csave # restore colors at entry
X rz -l $s_xtitle
X ifi $i0 != 0 # whoops
X {
X color red; echo -n '\nTRANSFER FAILED ... '
X ifi $i0 == 0x100 echo 'interrupt'
X ifi $i0 != 0x100 echo 'termination status '+%itos($i0,04d)
X goto SORRY
X }
X lookfor '% ' 50 # swallow prompt
X goto RETURN
X
XSORRY # whoops
X color red;echo 'rz_update failed ... sorry'
X $i_rtnval = 1 # return error
X
XRETURN
X echo ''
X color brown; echo -n 'remote user name '
X color yellow
X ifi $i_suflag != 0 # we su'd
X {
X send -n %chr(0x04) # will force a new prompt from remote
X echo -n $s_ruser
X color brown; echo ' restored (sent ^D to '+%argv(4)+' shell)'
X lookfor '% ' 50 # swallow prompt
X }
X else
X color brown; echo 'unchanged'
X
X ifs $s_rdir != %argv(1) # if we did a remote cd
X {
X send 'cd '+$s_rdir # restore original
X lookfor '\n'
X color brown; echo -n 'remote working directory '
X color yellow; echo -n $s_rdir
X color brown; echo ' restored'
X }
X else
X {
X send '' # spark a prompt
X color brown; echo -n 'remote working directory '
X color yellow; echo -n $s_rdir
X color brown; echo ' unchanged'
X }
X
X ifs $s_origdir != %dir # restore original directory
X {
X cd $s_origdir
X color brown; echo -n 'local working directory '
X color yellow; echo -n $s_origdir
X color brown; echo ' restored'
X }
X
X icolor $i_csave # restore colors at entry
X echo ''
X return $i_rtnval # return selected error code (bomb procedure if error)
SHAR_EOF
chmod 0644 models/rz_update.ep ||
echo 'restore of models/rz_update.ep failed'
Wc_c="`wc -c < 'models/rz_update.ep'`"
test 5129 -eq "$Wc_c" ||
echo 'models/rz_update.ep: original size 5129, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/scm.ep ==============
if test -f 'models/scm.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/scm.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/scm.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/scm.ep' &&
X# CHK=0x01CA
X#+------------------------------------------------------------
X# scm.ep - goto scm and use wht .cshrc
X#-------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-26-1989-19:25-wht-working with su.ep - no longer secret
X
X mkvar icsave; $icsave = %colors
X do 'su' 'scm' 'secret'
X lookfor '% ' 70 # swallow prompt left by su.ep
X color gray
X send 'source ~wht/.cshrc'
X lookfor -e '\n' 70
X ifs %argv(1) != '.'
X {
X lookfor '% ' 70 # swallow prompt
X send 'cd'
X lookfor -e '\n' 50 # send 'cd', swallow echo
X }
X icolor $icsave
SHAR_EOF
chmod 0644 models/scm.ep ||
echo 'restore of models/scm.ep failed'
Wc_c="`wc -c < 'models/scm.ep'`"
test 740 -eq "$Wc_c" ||
echo 'models/scm.ep: original size 740, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/senddate.ep ==============
if test -f 'models/senddate.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/senddate.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/senddate.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/senddate.ep' &&
X# CHK=0x067D
X#+----------------------------------------------
X# senddate.ep
X#-----------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-27-1989-17:02-wht-working
X
X mkvar icsave;$icsave = %colors
X color blue
X echo -n 'remote root password? '
X color black
X $s0 = %cgets
X icolor $icsave
X do 'su' 'root' $s0
X $s0 = '' # forget password
X lookfor '% ' 50 # swallow prompt
X send 'date'
X lookfor -e '% ' 50
X system -l 'senddate'
X lookfor -e quiet 20
X send -n %chr(0x04)
SHAR_EOF
chmod 0644 models/senddate.ep ||
echo 'restore of models/senddate.ep failed'
Wc_c="`wc -c < 'models/senddate.ep'`"
test 654 -eq "$Wc_c" ||
echo 'models/senddate.ep: original size 654, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/sf_test.ep ==============
if test -f 'models/sf_test.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/sf_test.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/sf_test.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/sf_test.ep' &&
X#--------------------------------------------------------------------
X# sf_test.ep - test various string functions
X#
X#Sample execution:
X#% ecu -p sf_test
X#
X# ecu x3.00.05.00-386u by wht@n4hgf (pid 5890)
X#
X# procedure is sf_test run on Mon 08-13-1990 at 15:39:17 (19:39 UTC)
X# username is "wht"
X# current directory is "/u1/src/ecu/models"
X#
X# %instr('abcdefabcdefghi','def') = 3
X# %rinstr('abcdefabcdefghi','def') = 9
X#
X# %basename('/u1/src/src/foo.c','.c') = "/u1/src/src/foo"
X# %basename('foo.c','.c') = "foo"
X# %basename('foo.c','.x') = "foo.c"
X#
X# %dirpart('/u1/src/src/foo.c') = "/u1/src/src"
X# %dirpart('foo.c') = "foo.c"
X# %dirpart('/usr') = ""
X#
X# %filepart('/u1/src/src/foo.c') = "foo.c"
X# %filepart('foo.c') = "foo.c"
X#
X# %envvar('HZ') = "100"
X# %envvar('HOME') = "/u9/wht"
X# %envvar('FOOBARTZHUMMER') = ""
X#
X# errno 1 = "Not owner"
X# 5678 seconds is "01:34:38"
X# mode 105755 is "-rwsr-xr-t"
X# [procedure finished]
X#
X#
X# [no line attached by initial procedure]
X# [press ESC to exit or SPACE for setup menu]
X#
X#--------------------------------------------------------------------
X
X echo ''
X echo -n 'procedure is '+%argv(0)+' run on '+%day+' '+%date
X echo ' at '+%times+' ('+%timez+' UTC)'
X echo 'username is "'+%logname+'"'
X echo 'current directory is "'+%dir+'"'
X
X echo ''
X echo -n '%instr(\'abcdefabcdefghi\',\'def\') = '
X echo %itos(%instr('abcdefabcdefghi','def'))
X
X echo -n '%rinstr(\'abcdefabcdefghi\',\'def\') = '
X echo %itos(%rinstr('abcdefabcdefghi','def'))
X
X echo ''
X echo -n '%basename(\'/u1/src/src/foo.c\',\'.c\') = '
X echo '"'+%basename('/u1/src/src/foo.c','.c')+'"'
X
X echo -n '%basename(\'foo.c\',\'.c\') = '
X echo '"'+%basename('foo.c','.c')+'"'
X
X echo -n '%basename(\'foo.c\',\'.x\') = '
X echo '"'+%basename('foo.c','.x')+'"'
X
X echo ''
X echo -n '%dirpart(\'/u1/src/src/foo.c\') = '
X echo '"'+%dirpart('/u1/src/src/foo.c')+'"'
X
X echo -n '%dirpart(\'foo.c\') = '
X echo '"'+%dirpart('foo.c')+'"'
X
X echo -n '%dirpart(\'/usr\') = '
X echo '"'+%dirpart('/usr')+'"'
X
X echo ''
X echo -n '%filepart(\'/u1/src/src/foo.c\') = '
X echo '"'+%filepart('/u1/src/src/foo.c')+'"'
X
X echo -n '%filepart(\'foo.c\') = '
X echo '"'+%filepart('/u1/src/src/foo.c')+'"'
X
X echo ''
X echo '%envvar(\'HZ\') = "'+%envvar('HZ')+'"'
X echo '%envvar(\'HOME\') = "'+%envvar('HOME')+'"'
X echo '%envvar(\'FOOBARTZHUMMER\') = "'+%envvar('FOOBARTZHUMMER')+'"'
X
X echo ''
X echo 'errno 1 = "'+%errstr(1)+'"'
X echo '5678 seconds is "'+%etime(5678)+'"'
X echo 'mode 105755 is "'+%fmodestr(0o105755)+'"'
SHAR_EOF
chmod 0644 models/sf_test.ep ||
echo 'restore of models/sf_test.ep failed'
Wc_c="`wc -c < 'models/sf_test.ep'`"
test 2490 -eq "$Wc_c" ||
echo 'models/sf_test.ep: original size 2490, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/su.ep ==============
if test -f 'models/su.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/su.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/su.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/su.ep' &&
X# CHK=0x120D
X#+---------------------------------------------------------
X# su.ep - switch user at remote
X# wht%n4hgf@gatech.edu
X#
X# do su 'username' 'password' ['.']
X#
X# expects new user to be running csh
X#----------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-27-1989-12:43-wht-"get prompt" message was wrong
X#:06-25-1989-13:56-wht-new do command syntax
X#:06-25-1989-12:33-wht-new if/while syntax
X#:06-16-1989-18:12-wht-creation
X
X mkvar icsave; $icsave = %colors
X
X color gray
X send 'su '+%argv(1)
X lookfor -e 'word:' 70
X ifi $i0 == 0
X {
X color red;echo 'su: failed to get password prompt'
X icolor $icsave; return 1
X }
X send %argv(2); lookfor '\n' 50 # send password
X echo ''
X lgets $s0 70 5 '\n'
X ifi %instr($s0,'Sorry') >= 0
X {
X color red;echo 'su: remote said "Sorry"'
X icolor $icsave; return 1
X }
X nap 5 # wait .5 sec
X send 'set prompt="% "' # set '% ' as prompt
X lookfor '\n' 20 # swallow echo of set command
X lookfor '% ' 60 # look for new prompt
X ifi $i0 == 0
X {
X color lt_red
X echo 'timeout on prompt ... system may be slow ... waiting 5 more secs'
X color gray
X lookfor '% ' 50 # look for new prompt
X }
X ifi $i0 == 0
X {
X color red;echo 'su: failed to "get prompt" echo'
X icolor $icsave; return 2
X }
X ifs %argv(3) == '.'
X send 'source ~wht/.cshrc'
X else
X send ''; lookfor '\n' 50 # kick off another prompt
X icolor $icsave
SHAR_EOF
chmod 0644 models/su.ep ||
echo 'restore of models/su.ep failed'
Wc_c="`wc -c < 'models/su.ep'`"
test 1562 -eq "$Wc_c" ||
echo 'models/su.ep: original size 1562, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/sysname.ep ==============
if test -f 'models/sysname.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/sysname.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/sysname.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/sysname.ep' &&
X#-----------------------------------------------------------
X# sysname.ep - procedure to call UNIX-like system 'sysname'
X#
X# CONFIDENTIAL - This function should be chmod 0600 because
X# it contains a password which you probably don't want to be
X# common knowledge.
X#
X# This procedure calls 'unixlogin.ep' to do the hard work.
X#-----------------------------------------------------------
X
X mkvar $s_pwd(20) # local variable preserves password
X $s_pwd = 'password' # security by disappearing when the
X # procedure terminates
X
X# also, by keeping the password text off the following line,
X# the password will not be displayed if you abort (interrupt)
X# the procedure
X
X do 'unixlogin' %argv(0) 'username' $s_pwd 'ansi-or-whatever'
SHAR_EOF
chmod 0644 models/sysname.ep ||
echo 'restore of models/sysname.ep failed'
Wc_c="`wc -c < 'models/sysname.ep'`"
test 766 -eq "$Wc_c" ||
echo 'models/sysname.ep: original size 766, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/sz_update.ep ==============
if test -f 'models/sz_update.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/sz_update.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/sz_update.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/sz_update.ep' &&
X# CHK=0x4068
X#--------------------------------------------------------------
X# sz_update.ep - update local directory
X#
X# parameters:
X# %argv(1) = remote directory to copy to
X# %argv(2) = local directory to copy from
X# %argv(3) = file list to send
X# %argv(4) = remote username needed, if any, else null
X# if %argv(4) not null, 'su_'+%argv(4)+".ep" must
X# exist to su to remote
X# %argv(5) name of superior procedure
X#
X#--------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:05-10-1992-09:22-wht@n4hgf-%conn can be -1 now
X#:05-21-1991-20:14-wht@n4hgf-was reporting skipped files as failed transfer
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:06-28-1989-19:36-wht-use named variables
X#:06-25-1989-13:56-wht-new do command syntax
X#:06-25-1989-12:33-wht-new if/while syntax
X#:06-22-1989-13:30-wht-creation
X
X# variable usage
X mkvar $i_csave # color settings at entry to procedure
X mkvar $i_suflag # true if su occurred
X mkvar $i_rtnflag # return code
X mkvar $s_origdir(128) # original working directory
X mkvar $s_ruser(16) # remote username we started with before su
X mkvar $s_rdir(128) # remote directory we started with
X mkvar $s_xtitle(64) # title for xfer
X
X $i_csave=%colors # get colors at entry
X
X $s0=%argv(0)+' '+%argv(5)+' '+%rname+' '+%argv(1)
X logevent $s0
X
X $s_xtitle = 'Connected to '+%rname
X ifs %argv(5) != ''
X $s_xtitle = $s_xtitle+' - procedure '+%argv(5)
X
X# check to make sure we are connected
X ifi %conn <= 0
X {
X color red; echo 'not connected to anyone!'
X goto SORRY
X }
X color lt_blue; echo 'Connected to '+%rname
X
X# save local current directory and change to target
X $s_origdir=%dir
X color brown
X ifs $s_origdir == %argv(2)
X echo -n 'local directory already '
X else
X {
X cd %argv(2)
X echo -n 'local directory set to '
X }
X color yellow; echo %dir
X
X# make sure remote username ok
X ifs %argv(4) == '' goto REMOTE_CD # if any remote username
X do 'bsd_uname' # get $s0=username
X ifi $i0 == 0 goto SORRY # test failure
X $s_ruser = $s0 # save original remote username
X ifs $s0 != %argv(4)
X { # need to su
X color brown
X echo -n 'remote username '
X color yellow
X echo -n $s0
X color brown
X echo ' ... su to '+%argv(4)+' now'
X color gray
X do 'su_'+%argv(4) # call proc, which calls su.ep
X lookfor '% ' 50 # su leaves prompt in buffer: swallow
X do 'bsd_uname' # make sure we su'd
X ifi $i0 == 0 goto SORRY
X ifs $s0 != %argv(4) # failed to su?
X {
X color red;echo 'su to '+%argv(4)+' failed'
X goto SORRY
X }
X $i_suflag = 1 #remember we su'd
X } # now we are proper username on remote
X
X# establish proper remote working directory
XREMOTE_CD
X color gray
X $s0 = 'pwd';do 'oneline' # save old remote ...
X $s_rdir = $s0 # ... directory in $s_rdir
X ifs $s_rdir != %argv(1) # if cd needed, do it
X {
X send 'cd '+%argv(1) # remote cd
X lookfor -e '\n' 50 # echo command
X lookfor '% ' 50 # swallow prompt
X $s0 = 'pwd'
X do 'oneline' # make sure we got there
X ifs $s0 != %argv(1) # dir change failed
X {
X color red;echo 'remote cd failed'
X goto SORRY;
X }
X }
X color brown; echo -n 'remote directory '
X color yellow; echo %argv(1)
X
X# transfer files
X color lt_blue
X echo 'sz -n -f '+%argv(3)
X icolor $i_csave # restore colors at entry
X sz -nfl $s_xtitle '-w 16384 '+%argv(3)
X ifi $i0 > 127 # whoops
X {
X color red; echo -n '\nTRANSFER FAILED ... '
X ifi $i0 == 0x100 echo 'interrupt'
X ifi $i0 != 0x100 echo 'termination status '+%itos($i0,04d)
X goto SORRY
X }
X else ifi $i0 > 0
X {
X color yellow; echo %itos($i0)+' files skipped'
X }
X lookfor '% ' 50 # swallow prompt
X goto RETURN
X
XSORRY # whoops
X color red;echo 'sz_update failed ... sorry'
X $i_rtnflag = 1 # return error
X
XRETURN
X echo ''
X color brown; echo -n 'remote user name '
X color yellow
X ifi $i_suflag != 0 # we su'd
X {
X send -n %chr(0x04) # will force a new prompt from remote
X echo -n $s_ruser
X color brown; echo ' restored (sent ^D to '+%argv(4)+' shell)'
X lookfor '% ' 50 # swallow prompt
X }
X else
X color brown; echo 'unchanged'
X
X ifs $s_rdir != %argv(1) # if we did a remote cd
X {
X send 'cd '+$s_rdir # restore original
X lookfor '\n'
X color brown; echo -n 'remote working directory '
X color yellow; echo -n $s_rdir
X color brown; echo ' restored'
X }
X else
X {
X send '' # spark a prompt
X color brown; echo -n 'remote working directory '
X color yellow; echo -n $s_rdir
X color brown; echo ' unchanged'
X }
X
X color brown; echo -n 'local working directory '
X color yellow; echo -n $s_origdir
X color brown
X ifs $s_origdir != %dir # restore original directory
X {
X cd $s_origdir
X echo ' restored'
X }
X else
X echo ' unchanged'
X
X icolor $i_csave # restore colors at entry
X echo ''
X return $i_rtnflag # return selected error code (bomb procedure if error)
SHAR_EOF
chmod 0644 models/sz_update.ep ||
echo 'restore of models/sz_update.ep failed'
Wc_c="`wc -c < 'models/sz_update.ep'`"
test 4853 -eq "$Wc_c" ||
echo 'models/sz_update.ep: original size 4853, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/szall.ep ==============
if test -f 'models/szall.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/szall.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/szall.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/szall.ep' &&
X# CHK=0xE67C
X
X do 'put_mpad1'
X lookfor '% ' 40
X do 'put_kdir12'
X lookfor '% ' 40
X do 'put_sim'
X lookfor '% ' 40
X do 'put_ecu'
SHAR_EOF
chmod 0644 models/szall.ep ||
echo 'restore of models/szall.ep failed'
Wc_c="`wc -c < 'models/szall.ep'`"
test 127 -eq "$Wc_c" ||
echo 'models/szall.ep: original size 127, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/tty1a.mi ==============
if test -f 'models/tty1a.mi' -a X"$1" != X"-c"; then
echo 'x - skipping models/tty1a.mi (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/tty1a.mi (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/tty1a.mi' &&
X# CHK=0x10FF
X#+-----------------------------------------------------------------
X# tty1a.mi - Microcom AX/9624c
X# Copyright 1989 Warren H. Tucker, III. All Rights Reserved
X#------------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:11-03-1989-16:21-wht------ unet2 -----
X#:07-02-1989-20:51-wht-beef up init
X#:06-17-1989-22:02-wht-creation
X
Xinit_>2400:atq0e1v1x4s0=0s2=43s7=30\q1\x1\n3
Xinit_default:atq0e1v1x4s0=0s2=43s7=30\q0\x0\n0
Xdial_default:atdt
Xautoanswer:atq1s0=1
SHAR_EOF
chmod 0644 models/tty1a.mi ||
echo 'restore of models/tty1a.mi failed'
Wc_c="`wc -c < 'models/tty1a.mi'`"
test 592 -eq "$Wc_c" ||
echo 'models/tty1a.mi: original size 592, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/tty2d.mi ==============
if test -f 'models/tty2d.mi' -a X"$1" != X"-c"; then
echo 'x - skipping models/tty2d.mi (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/tty2d.mi (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/tty2d.mi' &&
X# CHK=0xFA63
X#+-----------------------------------------------------------------
X# tty2d.mi - USR Courier 2400
X# Copyright 1989 Warren H. Tucker, III. All Rights Reserved
X#------------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:11-03-1989-16:21-wht------ unet2 -----
X#:07-02-1989-20:51-wht-beef up init
X#:06-17-1989-22:02-wht-creation
X
Xinit_default:atq0e1v1x4s0=0s2=43s7=30s11=47
Xdial_default:atdt
Xautoanswer:atq1s0=1
SHAR_EOF
chmod 0644 models/tty2d.mi ||
echo 'restore of models/tty2d.mi failed'
Wc_c="`wc -c < 'models/tty2d.mi'`"
test 543 -eq "$Wc_c" ||
echo 'models/tty2d.mi: original size 543, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/unixlogin.ep ==============
if test -f 'models/unixlogin.ep' -a X"$1" != X"-c"; then
echo 'x - skipping models/unixlogin.ep (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/unixlogin.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/unixlogin.ep' &&
X# CHK=0xE6DC
X#+-----------------------------------------------------------------
X# unixlogin.ep - ecu UNIX login procedure
X# Copyright 1989 Warren H. Tucker, III. All Rights Reserved
X#
X# %argv(1) = remote name
X# %argv(2) = user name
X# %argv(3) = password
X# %argv(4) = term type
X# %argv(5) = optional number of breaks needed
X#
X# To use to call system 'xyz' in the dialing directory, make a
X# procedure called xyz.ep doing something like:
X#
X# $s0='password'
X# do 'unixlogin' 'xyz' 'username' $s0 ''
X#
X# This procedure sets $i0 to 0 if connect succeeds, else 1
X# as required of an ecu dialing procedure
X#+-----------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:05-10-1992-09:22-wht@n4hgf-%conn can be -1 now
X#:12-02-1991-22:07-wht@n4hgf-better doc
X#:07-12-1990-14:05-wht@n4hgf-use expresp
X#:07-11-1989-16:55-wht-get cmd became lgets
X#:07-09-1989-23:50-wht-add breaks
X#:06-28-1989-19:36-wht-use named variables
X#:06-25-1989-13:56-wht-new do command syntax
X#:06-25-1989-12:33-wht-new if/while syntax
X#:06-23-1989-19:46-wht-improved hayes dialer reduces need to report dial fail
X#:06-19-1989-22:50-wht-use while and if statements
X#:06-14-1989-15:58-wht-add login capability when already connected
X#:06-11-1989-23:37-wht-creation
X
X mkvar $i_csave,$i_ltimeout,$i_retries
X mkvar $s_2048(2048) # handle bigger login big motd
X
X $i_csave = %colors
X $i_ltimeout = 30 # 3 seconds wait for first login prompt
X $i_retries=3
X
X color red; echo -n '\nauto-logon to '
X color yellow; echo -n %argv(1)
X color red; echo ' on '+%date+' at '+%time+'\n'
X
X ifi %argc < 5 # not enough args
X {
X color red
X echo %argv(0)+' needs 5 arguments (got '+%itos(%argc)+')'
X goto SORRY
X }
X mkvar $i_breaks
X ifi %argc > 5 $i_breaks = %stoi(%argv(5))
X
X ifi %conn <= 0 goto DIAL
X
X ifs %rname == %argv(1)
X {
X color brown; echo -n 'already connected to '
X color yellow; echo %rname
X send ''
X goto SEND_BREAKS
X }
X
XHANGUP
X ifi %conn <> 0 echo 'hanging up on '+%rname; hangup
X
XDIAL
X color green
X dial %argv(1); set $i1=$i0 #save dial result in $i1
X ifi $i1 == 2 color red; echo 'interrupted'; goto SORRY
X ifi $i1 != 0 goto SORRY
X
X# send breaks?
XSEND_BREAKS
X ifi $i_breaks > 0
X {
X color blue; echo 'sending up to '+%itos($i_breaks)+' break(s) to remote'
X nap 30
X whilei $i_breaks > 0
X {
X color magenta; echo 'BREAK'
X lbreak
X expresp '~t[8]gin:'
X ifi $i0 == 0
X break;
X nap 30
X $i_breaks = $i_breaks - 1
X }
X flush
X }
X
X# get login prompt from remote UNIX system: "login: "
XGET_LOGIN_PROMPT
X $i_retries = 3
XGET_LOGIN_PROMPT_RETRY
X ifi $i_retries <= 0
X {
X color red; echo '\ncannot seem to get in with these credentials'
X goto SORRY
X }
X color blue; echo 'looking for login prompt'
X color white
X expresp -v '~t[8]gin:--~t[5]gin:--gin:--gin:'
X ifi $i0 > 0
X {
X color red; echo '\nfailed to get login prompt'
X goto SORRY
X }
X icolor $i_csave
X
X# give username to remote
XSEND_USERNAME
X nap 3 # system not always ready when it says
X send %argv(2)
X
X# get password prompt: "Password:"
XGET_PASSWORD_PROMPT
X color white
X lookfor -e 'word:' 50
X ifi $i0 != 1 # did not find 'Password: '
X {
X send ''
X gotob GET_LOGIN_PROMPT_RETRY
X }
X
X# send the password
X nap 3 # system not always ready when it says
X send %argv(3)
X icolor $i_csave
X
X# get term type prompt "TERM = (ansi) "
X# also handle incorect login retry and 'Sorry' hangup indication
XGET_TERMTYPE_PROMPT
X ifs %argv(4) == '' # if no term type, don't wait for prompt
X {
X $i0 = 0 # return good status
X goto SETCOLOR_AND_RETURN_STATUS
X }
X lgets -re $s_2048 100 50 ') '
X ifi %instr($s_2048,'Sorry') > 0 hangup;goto SORRY
X ifi %instr($s_2048,'incorrect') > 0 # exhausted retry?
X {
X set $i_retries=$i_retries-1
X ifi $i_retries > 0 goto SEND_USERNAME
X goto SORRY
X }
X# send terminal type
X ifi %instr($s_2048,'TERM') < 0
X lookfor -e ') ' 30
X send %argv(4)
X lookfor -e '\n' 50
X set $i0=0
X goto SETCOLOR_AND_RETURN_STATUS
X
X# procedure failed
XSORRY
X set $i0=1
X
XSETCOLOR_AND_RETURN_STATUS
X icolor $i_csave
X ifi $i0 == 0 ifi %conn !=0 prompt %rname+' >'
X return $i0
X
X# vi:set tabstop=4 shiftwidth=4:
SHAR_EOF
chmod 0644 models/unixlogin.ep ||
echo 'restore of models/unixlogin.ep failed'
Wc_c="`wc -c < 'models/unixlogin.ep'`"
test 4161 -eq "$Wc_c" ||
echo 'models/unixlogin.ep: original size 4161, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= zgcc ==============
if test -f 'zgcc' -a X"$1" != X"-c"; then
echo 'x - skipping zgcc (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting zgcc (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'zgcc' &&
X#!/bin/csh
X#+-----------------------------------------------------------------------
X# zgcc
X# arg[1] - filename containing list of files
X# arg[2] - output filename
X# arg[3] - path to afterlint and mkoldproto
X# arg[4-] - CFLAGS
X#------------------------------------------------------------------------
X#+:EDITS:*/
X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
X#:01-21-1992-05:53-wht@n4hgf-add path as arg3
X#:08-11-1991-23:47-wht@n4hgf-thanks for the -p1 suggestion to sef@kithrup.com
X#zgcc -- build prototyping "PROTOTYPES"
Xecho C sources in $1';' result file $2
Xunset noclobber
Xset p=$argv[3]
Xrm -f zg.t
Xif (-e /unix)
X echo 'building old-style prototypes for XENIX compiler compatibility'
X echo 'unnamed struct/union as parameter warning probably about FILE :-('
Xendif
Xforeach i(`cat $1`)
Xif (-e /unix)
X cc -DBUILDING_PROTOTYPES -p1 /lib/p1 -Zg $argv[4-] $i | \
X $p/mkoldproto > zg1.t
Xelse
X cc -DBUILDING_PROTOTYPES -Zg $argv[4-] $i > zg1.t
Xendif
Xsort zg1.t > zg2.t
Xecho '/*' $i '*/' >> zg.t
Xcat zg2.t >> zg.t
Xend
X$p/afterlint zg.t $2
Xrm -f zg.t zg?.t
Xecho Output in $2
SHAR_EOF
chmod 0755 zgcc ||
echo 'restore of zgcc failed'
Wc_c="`wc -c < 'zgcc'`"
test 1125 -eq "$Wc_c" ||
echo 'zgcc: original size 1125, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= mkoldproto.l ==============
if test -f 'mkoldproto.l' -a X"$1" != X"-c"; then
echo 'x - skipping mkoldproto.l (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting mkoldproto.l (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'mkoldproto.l' &&
X/* CHK=0x5793 */
X%{
Xchar *rev = "1.00";
X/*+-------------------------------------------------------------------------
X mkoldproto.c.{l,c} - make "old" style prototypes from "new" kind
X
Xcc -Zg source.c | mkproto > lint_args.h
X
Xtakes prototypes of the style
Xvoid change_report(char *original);
Xand emits
Xvoid change_report(char *);
XThe UNIX V compiler makes the new kind, accepts the old and new kind,
Xbut there are a lot of compilers which don't like the new kind.
X
XWarning, this program will make mush out of "old" style prototypes
Xfed to it.
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
X/*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
X/*:11-27-1989-18:31-wht-creation */
X
Xint verbose = 0;
X
X/*+-------------------------------------------------------------------------
X change_report(original)
X--------------------------------------------------------------------------*/
Xvoid
Xchange_report(original)
Xchar *original;
X{
X fputs("fixing: ",stderr);
X while(*original)
X {
X if((*original >= ' ') && (*original <= '~'))
X fputc(*original,stderr);
X else
X fprintf(stderr,"<%02x>",*original);
X original++;
X }
X fputs("\n",stderr);
X} /* end of change_report */
X
X
X/*+-------------------------------------------------------------------------
X main(argc,argv,envp)
X--------------------------------------------------------------------------*/
Xmain(argc,argv,envp)
Xint argc;
Xchar **argv;
Xchar **envp;
X{
Xregister int itmp;
Xregister int iargv;
Xint fileiargv = 0;
X
X if(argc > 1)
X {
X for(iargv = 1; iargv < argc; iargv++)
X {
X if(argv[iargv][0] == '-')
X {
X switch(itmp = (argv[iargv][1]))
X {
X case 'v':
X verbose = 1;
X break;
X default:
X break;
X }
X }
X else
X {
X if(yyin != stdin)
X {
X fprintf(stderr,"only 1 filename, please\n");
X exit(1);
X }
X if( (yyin = fopen(argv[iargv],"r")) == NULL)
X {
X perror(argv[iargv]);
X exit(1);
X }
X fileiargv = iargv;
X }
X }
X }
X
X if(verbose && fileiargv)
X fprintf(stderr,"%s:\n",argv[fileiargv]);
X
X yylex();
X
X exit(0);
X} /* end of main */
X
X/* vi: set tabstop=4 shiftwidth=4: */
X%}
XW [ \t]
XSTRING \"([^"\n]|\\\")*\"
XOPCHARS ["'+-*/=|!&%^?><:\]]
XIDENT [a-zA-Z0-9_]+
XU "unsigned"
XI "int"
XL "long"
XS "short"
XC "char"
XR "register"
XST "static"
XI8 "INT8"
XI16 "INT16"
XI32 "INT32"
XUN_ST ("union "|"struct "){IDENT}
XDECLTAB1 ({I}|{C}|{S}|{L}|{U}|{R}|{ST}|{I8}|{I16}|{I32}|{UN_ST})[\t]{IDENT}
XDECLTAB2 ({I}|{C}|{S}|{L}|{U}|{R}|{ST}|{I8}|{I16}|{I32}|{UN_ST})[\t ][\t ]+{IDENT}
X%START COMMENT PREPROC
X%%
X<PREPROC>.*\n {ECHO;
X BEGIN 0;
X }
X^"#" {
X ECHO;
X BEGIN PREPROC;
X }
X<COMMENT>([^*\n]|"*"+[^*/\n])* ECHO;
X<COMMENT>([^*\n]|"*"+[^*/\n])*"*"*"*/" {ECHO;
X BEGIN 0;
X }
X<COMMENT>.|\n ECHO;
X"/*" {
X ECHO;
X BEGIN COMMENT;
X }
X"extern " {
X ;
X }
X"* " {
X fprintf(yyout,"*");
X }
X{IDENT}"," {
X register char *cptr = yytext + yyleng - 1;
X if(verbose)
X change_report(yytext);
X while((*cptr != '\t') && (*cptr != ' ') && (*cptr != '*'))
X *cptr-- = 0;
X fprintf(yyout,",",yytext);
X }
X{IDENT}")" {
X register char *cptr = yytext + yyleng - 1;
X if(verbose)
X change_report(yytext);
X while((*cptr != '\t') && (*cptr != ' ') && (*cptr != '*'))
X *cptr-- = 0;
X fprintf(yyout,")",yytext);
X }
X{STRING} ECHO;
X"'"."'" ECHO;
X.|\n ECHO;
X
SHAR_EOF
chmod 0644 mkoldproto.l ||
echo 'restore of mkoldproto.l failed'
Wc_c="`wc -c < 'mkoldproto.l'`"
test 3523 -eq "$Wc_c" ||
echo 'mkoldproto.l: original size 3523, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
rm -f _shar_seq_.tmp
echo You have unpacked the last part
exit 0
exit 0 # Just in case...