$ !
$ ! FMSTRT.COM
$ !
$ !                     Copyright (c) 1987 by
$ !             Digital Equipment Corporation, Maynard, MA.
$ !
$ !
$ !  This file may be added to your system startup procedure to add the FMS
$ !  CCL's and resident libraries.
$ !
$ !  NOTE:  You should edit this file to reflect the FMS installation options
$ !         you have chosen.

$ ! Set up the environment.
$	_ON ERROR THEN GOTO ERROR
$	_ON CONTROL_C THEN GOTO ABORT

$	debug = p1

$ ! Set up local symbols
$	PRINT$ = "_WRITE 0"

$ ! Set up local boolean symbols
$	false = 0
$	true = .NOT. false
$	aborting = false

$START:
$	time = F$TIME()

$	PRINT$ time, "   Starting FMS-11/RSTS"

$	_IF debug THEN _GOTO END

$	priv = F$PRIVILEGE("INSTAL,SWCFG")
$	   _IF priv THEN _GOTO REMOVE

$		PRINT$ "Insufficient privileges"
$		_GOTO ABORT

$REMOVE:
$ ! Remove old FMS-11/RSTS CCLs.
$	_ON ERROR THEN _GOTO DEFINE             ! If not defined.
$	_SET NOECHO/NOWARNING
$	_DELETE/COMMAND/SYSTEM FED
$	_DELETE/COMMAND/SYSTEM FUT
$	_REMOVE/LIBRARY FDVRES
$	_REMOVE/LIBRARY FDVRDB

$DEFINE:
$ ! Define FMS-11/RSTS CCLs.
$	_ON ERROR THEN _GOTO ERROR              ! Restore error handler.
$	_SET NOECHO/WARNING
$	_DEFINE/COMMAND/SYSTEM FED- FMS$:FED.TSK
$	_DEFINE/COMMAND/SYSTEM FUT- FMS$:FUT.TSK
$	_INSTALL/LIBRARY SY:[0,1]FDVRES
$	_INSTALL/LIBRARY SY:[0,1]FDVRDB

$	_GOTO END

$ABORT:
$	aborting = true

$ERROR:
$	time = F$TIME()
$	PRINT$ time, " Unable to start FMS-11/RSTS"

$END:
$	status = $SEVERITY
$	   _IF aborting THEN status = 4         ! Force fatal.

$	time = F$TIME()
$	PRINT$ time, "   The FMS-11/RSTS Startup Procedure is complete."

$	_EXIT status

