#! /mnt/j2-1/joshua/proj/GlobalBase/new/bin/xl
<?xml version="1.0" encoding="Shift_JIS" ?>

<Define> ^st_arg 1 </Define>
<Load option="exec"> xlconf/std/agent.xl </Load>

<Switch>
<Case> (= (Arg st_arg) "start")
	(Shell "xlsv xlscript/std/server.xl &amp;")
	(Shell "xllock xlscript/std/lockserver.xl &amp;")
</Case>
<Case> (= (Arg st_arg) "stop")

	<Load option="exec"> xlconf/std/root.passwd.xl </Load>

	<ErrHandler><Define> ^id
	   <OpenInterpreter>
		connect
		<CurrentEnvironment/>
		<Port> ^ServerPort </Port>
		<HostName>localhost</HostName>
	   </OpenInterpreter>
	</Define></ErrHandler>

	<ErrHandler><Remote> ^id
	   <SetAgent> server root</SetAgent>
	</Remote></ErrHandler>
	<ErrHandler><Remote> ^id <Exit/> </Remote></ErrHandler>

	<Define> ^id
	   <OpenInterpreter>
		connect
		<CurrentEnvironment/>
		<Port> ^LockPort </Port>
		<HostName>localhost</HostName>
	   </OpenInterpreter>
	</Define>
	<ErrHandler><Remote> ^id <Exit/> </Remote></ErrHandler>
</Case>
</Switch>

