$ port = 8135 $ env = f$environment("PROCEDURE") $ home = f$parse("Z.Z;",env,,,"NO_CONCEAL") - "Z.Z;" $ node = f$getsyi("NODENAME") $ $ define sys$output 'home'mansrv.log $ set verify $ $ if P1.nes."SETUP" then goto RUN $ $SETUP: $ netcu remove service 'port' bg_tcp $ $ netcu add service 'port' bg_tcp /routine=create_server_process /input='home'mansrv.com - /backlog=1 - /limit=1 - /user=system $ exit $ $RUN: $ open/write net sys$net $ CR[0,8] = 13 $ LF[0,8] = 10 $ getuai := $tools:getuai $ uaf := $authorize $ $LOOP: $ !++ $ ! Write a command prompt $ !-- $ write net CR,LF $ write net "MANSRV>" $ $ !++ $ ! Start reading of a command input (with timout) $ !-- $ read/end=quit/err=quit/timeout=15 net sts $ $ !++ $ ! Extract a command string and parse arguments $ !-- $ sts = f$elem(0,CR,sts) $ sts = f$edit(sts,"TRIM,UPCASE,COMPRESS") $ cmd = f$elem(0," ",sts) $ arg1 = f$elem(1," ",sts) $ arg2 = f$elem(2," ",sts) $ $ !++ $ ! Send a parsed command and parameters $ !-- $ write net "MANSRV-I-CMD, CMD=<''cmd'>,arg1=<''arg1'>,arg2=<''arg2'>" $ $ !++ $ ! Processing a requested command $ !-- $ $ if cmd.eqs."DISABLE" $ then $ !++ $ ! Check an account UCI group $ !-- $ getuai 'arg1' /uic=uic $ grp = f$int(f$elem0,",",uic) - "[") $ if grp.lt.200 then $goto QUIT $ $ !++ $ ! Just set the DisUser flag for an account $ !-- $ uaf mod 'arg1' /flag=disuser $ write net f$message(status) $ endif $ $ if cmd.eqs."QUIT" then $goto QUIT $ $ goto loop $QUIT: $ $ close net $ exit 1