I am try to create a .sh file to check to see if the server is running and if not to start it. i am not getting any echo's from this script or any fails but it is not running. can some one help me fix this or a better way to right it. i am not a programmer i just edited a few others scripts to get this.
JAVA="java -Xms512M -Xmx3072M -XX:PermSize=128m -jar FTBServer.jar nogui" DIR="/home/jon/FTB/FTBnew" if [ "$1" = start ] ; then if ps -ef | grep FTBServer.jar | grep -v -q grep ; then echo "Minecraft is already running" else echo "Starting!" && cd $DIR && screen -dmS minecraft $JAVA sleep 7 if ps -ef | grep minecraft_server.jar | grep -v -q grep ; then echo "Minecraft server started successfully" else echo "Minecraft server failed to start" fi fi fi
this is what i get and when i run it
root@FTB:/home/jon/FTB/FTBnew# bash Check.sh root@FTB:/home/jon/FTB/FTBnew#