#!/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 update.sh update.sh_cur
     unzip -o last_ver.dat 
     mv -f update.sh_cur update.sh
     rm -rf last_ver.dat
   else
      exit $exit_status;
   fi
sleep 3;
done;
