<project name="OSCAR 1.0.0 Telnet-based Batch" default="main" basedir=".">
	<description>This buildfile is used to send commands to a telnet shell</description>

	<!-- Set project properties -->
	<!--  <property file="./project.properties"/> -->
	<property name="host" value="localhost"/>
	<property name="port" value="6623"/>
	<!-- General properties -->

	<!-- Initialize, etc. -->
	<target name="init">
		<echo>Start the Telnet Service on the gateway (obr start "Telnet Service")</echo>
		<input>Then press Return key to continue...</input>
	</target>

	<!-- Compile  -->
	<target name="main" depends="init">
		<echo>Connecting to ${host}:${port}</echo>
		<telnet port="${port}" server="${host}" timeout="20">
			<!-- select the OSCAR shell -->
			<read><![CDATA[Enter Choice>]]></read>
			<write>OSCAR</write>
			<!-- send the batch of commands -->
			<!-- wait for the prompt string before sending the next command -->
			<read><![CDATA[->]]></read>
			<write>obr help</write>
			<read><![CDATA[->]]></read>
			<write>obr start "Http Admin"</write>
			<read><![CDATA[->]]></read>
			<write>obr bstart http://www-adele.imag.fr/~donsez/dev/osgi/helloservlet/helloservlet.jar</write>
			<read><![CDATA[->]]></read>
			<write>ps</write>
		</telnet>
	</target>
</project>
