/**************************************************************************\ $VER:iNTERNET-aVAIL V1.4 cNZ^pST \**************************************************************************/ nodes='3' /*** Amount of TELNET nodes ***/ node.0='4' /*** Port# of first telnet node ***/ node.1='5' /*** Port# of second telnet node ***/ node.2='6' /*** Port# of third telnet node (Add more if you need) ***/ options results;ss=sendstring;gu=getuser;getuser 23;port=result;gu 1311992;pdir=result;onlinet=0 signal on SYNTAX;signal on ERROR;signal on IOERR changewhere "Checking if Internet is available" address MIAMI.1;options results;GETONLINETIME;onlinet=result SYNTAX:;ERROR:;IOERR: address value "CNETREXX"port options results if exists('ram:env/hostname') then do call open(datafil,'ram:env/hostname','R') ipnr=readln(datafil) call close(datafil) end sendfile pdir'sys.internet_avail' ss '.---------------------------------------------------------------------------.n1 |  iNTERNET aVAIL V1.4  |n1 |---------------------------------------------------------------------------|' s='0' do until s=nodes getportid node.s;userid=result if userid>-1 then do LOADSCRATCH userid GETSCRATCH 1;username=result GETSCRATCH 59;ulocation=result SAVESCRATCH 0-userid end if userid=-1 then do username='' ulocation='' end cid='' /* Ta bort denna rad då callerid används */ ss 'n1| tELNET-nODE o's+1'. 'left(username,16,' ')' 'left(ulocation,23,' ')' c6'right(cid,15)' |' s=s+1 end if onlinet='0' then do;timevar='';ipnr='uNaVAILABLE';calctime='0';end if onlinet>0 then do if onlinet>86399 then do;timevar='day';calctime=left(onlinet/86400,2);calctime=compress(calctime,'.');call done;end if onlinet>3599 then do;timevar='hrs';calctime=left(onlinet/3600,2);calctime=compress(calctime,'.');call done;end if onlinet>59 then do;timevar='min';calctime=left(onlinet/60,2);calctime=compress(calctime,'.');call done;end if onlinet>0 then do;timevar='sec';calctime=onlinet;call done;end end done: ss "||n1|.---------------------------------------. .---------------------.|n1 || iP# fOR tELNET iN iS "center(ipnr,17)"| |z4cf oNLINE tIME z0c6 "left(calctime' 'timevar,7)"c5|| n1 |____ `---------------------------------------' `---------------------' ____|n1 cNZ/___________________________________________________________________\^pSTn1" exit /** Last Edited: 26-Jun-97 ************************************************\ \*********************************** wORLD tRADE cENTER (+46)/031-128047 **/