bash - Issues with Screen - Running Minecraft in a while loop through a screen session -


so earlier today, changed startup scripts minecraft server. problem is, after 3 hours, screen open vanished , refuses appear when using -ls. server still running , can see below, screen process should still active? serverstart.sh called during init. , contained while loop.

serverstart.sh:

#/bin/bash     #check see if minecraft screen running linecount=`screen -r mc | grep "there no screen resumed matching mc." | wc -l`  #start minecraft server in detached screen named "c" if not running #launch command line interface minecraft if arealdy running. if [ $linecount -eq 1 ]       echo linecount: $linecount. starting in deteched screen named minecraft. use screen -r minecraft view.     screen -dms mc sh serverloop.sh   else     echo linecount: $linecount. minecraft running. use screen -r minecraft view. running now.     screen -r mc fi 

serverloop.sh:

#/bin/bash while true java -server -xms4096m -xmx16384m -xx:permsize=512m -d64 -xx:+useparnewgc -xx:+cmsincrementalpacing -xx:+cmsclassunloadingenabled -xx:parallelgcthreads=2 -xx:minheapfreeratio=5 -xx:maxheapfreeratio=10 -jar ftb.jar nogui echo restarting-give me 90 seconds. sleep 10 done 

it seems getting random additions of ^m whilst transferring via ftp due writing scripts in notepad++. weren't added every revision of code though, wasn't consistent thing. stopping start.sh running without giving real notion why.

for reference others, below has been working fine throughout multiple daily restarts past 48hrs+, across 2 different servers. else may find useful, minecraft or other similar task.

serverstart.sh

#/bin/bash screen -dms infitech sh ./start.sh screen -r infitech

start.sh

#/bin/bash while true java -xms8192m -xmx10240m -xx:permsize=512m -jar server-1.7.10-1403.jar nogui -dfml.queryresult=confirm echo "feel free ctrl+c stop server" sleep 10 done


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -