#!/bin/bash
while true;
do
	./jre/bin/java -server -cp "dependency/*" ru.p5277.controller.Main -l 2 -siteid 1 -P TCP -dse > output.log
	exit_status=$?
	if [ $exit_status -eq 2 ]; then
	  rm -rf cip lib
	  cp -Rpf last_ver.dir/c5277/* . > /dev/null 2>&1
	  rm -rf last_ver.dir
	else
		exit $exit_status;
	fi
sleep 3;
done;
