      REM PLW-SUPERVISOR
*PIC-LAN
*
*ALL
*PC
*N
*
*
*
*
      INCLUDE SYS.TYPE.INCLUDE
*
      INCLUDE PL.COMMON
      INCLUDE PL.COMMON.DEFS
      INCLUDE PL.DEFS
      INCLUDE PLIP.COMMON
      INCLUDE PLW.COMMON
      INCLUDE PL.INIT.INCLUDE
*
      E.FLG = ''
      CRLF = CR : LF
*
      MAT PLS$VARS = ''
*
      CALL PLIP.INIT.SUB
      CALL PLW.INIT.SUB('RUN')
*
      CALL PLWS.GETLOCK(PL$LOCK.FD,'WWW.CTRL,LOCK','SUPERVISOR-PROCESS',L.PORT)
      IF L.PORT <> '' THEN
         PRINT 'A supervisor is already running on port ' : L.PORT
         STOP
      END
*
      DELETE PL$CTRL.FD , 'CONFIG-EXIT'
*
      IF PLIP$SUP.PORT = '' THEN
         PRINT 'No SUPERVISOR port configured'
         STOP
      END
*
      IF PLIP$SUP.PORT = '*' THEN
         PRINT 'Starting PicLan-IP SUPERVISOR on phantom'
         PL_EXECUTE 'PHANTOM PLW-SUPERVISOR'
      END
*
      IF NOT(INDEX(SENT<2>,'M',1)) THEN
         PL_EXECUTE 'PLIP-MONITOR'
      END
   END
