#/bin/bash # shell script for activating remote TSO 3270 Teminals via V NET,ACT # # to do: tso terminals should initially be varied INACT # # the "download" for copying URLS to stdout can be downloaded # from http://tschmidt.de/tsu/hercules # # # author: thorsten schmidt tschmidt@tschmidt.de # # # ## erase history record >/tmp/tsoterm # ## check tso terminal connections and disconnections periodically while sleep 15 do ## attach hercules loc via http port and check for new messages HHC603/4 download http://localhost:8081/cgi-bin/syslog | grep HHC60[34]I | tail -1 | comm -23 - /tmp/tsoterm > /tmp/tsoneu # ## if there is something new if test -s /tmp/tsoneu then ## build new history record and submit console command jcl cat /tmp/tsoneu | tee /tmp/tsoterm | awk '{ print "//HERC01VA JOB (SETUP),TSCHMIDT,CLASS=A,MSGCLASS=A" print "//VARYNET EXEC PGM=BSPOSCMD" print "//*" $0 print "//SYSPRINT DD SYSOUT=*" print "//SYSIN DD *" if ($1 == "HHC604I") printf "V NET,ACT,ID=CUU%s\n", substr($8,2,3) else printf "V NET,INACT,ID=CUU%s\n", substr($3,2,3) }' | netcat -w1 -vv localhost 3505 fi done