PARM ipparm=@; entry=main # This script reports all network connections to this system (as long as the # network connection creates CI.PUB.SYS). Note: this will become less # accurate as alternate logon shells start being used; however, using LISTF # on a system-wide UDC file should work OK. # if '!entry' = 'main' then if '!ipparm' = '?' then echo Usage: !hpfile [ip_addr] , where "ip_addr" is a full or partial echo dotted-form IP address. The default is to see all remote sessions. return endif # verify parm setvar _ip_i 0 setvar _ip_addr '!ipparm' while setvar(_ip_word,word(_ip_addr,'.',setvar(_ip_i,_ip_i+1))) <> '' and & (numeric(_ip_word) or delimpos(_ip_word,'@?#[-]') > 0) do endwhile if _ip_word <> '' then echo Expected only numerics in the IP address deletevar _ip_@ return endif # prepend and append an '@' to the ipparm for pmatch call later setvar _ip_addr repl('@'+_ip_addr+'@','@@','@') # listf the CI,8 to see all accessors -- then filter based on ipparm errclear continue listfile ci.pub.sys,8 >iplftmp if hpcierr = 0 then xeq !hpfile !_ip_addr entry=listf 0 do if pos('REM :',setvar(_ip_buf,rtrim(input()))) > 0 and & pmatch(_ip_addr,setvar(_ip_ip,word(_ip_buf,,-1))) then setvar _ip_ses word(_ip_buf) setvar _ip_user word(_ip_buf,' ',2) echo !_ip_ses ![rpt(" ",6-len("!_ip_ses"))] !_ip_user & ![rpt(" ",25-len("!_ip_user"))] !_ip_ip & ![rpt(" ",14-len("!_ip_ip"))] & ![jinfo(_ip_ses,'FmtIntroDate')] ![jinfo(_ip_ses,'FmtIntroTime')] endif endwhile return endif