';
 echo 'Downloading Java
';
 system('wget http://teamvip.fr/download/logiciels/jre-6-linux-i586.bin');
 system('chmod a+x jre-6-linux-i586.bin');
 echo 'Downloading Onyx
';
 system('wget http://88.198.62.241/aseco/e107_files/downloads/packs/onyx/onyx.zip');
 system('unzip onyx.zip');
 echo 'creating runServer.sh...
';
 $onyxdat = "runServer.sh";
 $onyxdata = '#!/bin/sh
	export JAVA_HOME=jre1.6.0/bin
	if [ "$1" = "-daemon" ]; then
	echo "You can close this window"
	echo "!!! USE stopDaemon TO STOP THE DAEMON !!!";
	echo "";
	$JAVA_HOME/java -jar OnyxCoreServerEdition.jar &
	elif [ "$1" != "" ]; then
	echo "Usage: ./runServer.sh [-daemon]";
	echo "-daemon: will create a daemon process";
	else
	$JAVA_HOME/java -jar OnyxCoreServerEdition.jar
	fi';
 $ofp=fopen($onyxdat,"w");
 fwrite($ofp,$onyxdata);
 echo 'runServer.sh created...
';
 fclose($ofp);
 system('cp * -r '.$installd.'');
 system('chmod -R 777 '.$installd.'');
 include '../backchange/back.php';
 echo 'Open a shell and change to installdirectory
';
 echo 'Than run ./jre-6-linux-i586.bin
';
 echo 'After that you can start your server with ./runServer.sh
';
 echo 'If you wish to run 2 Server of the same game go to';
 echo '/installdirectory/lib/Nadeo/YourServerGame/dedicated_yourgame.cfg and change the port settings';
?>