Posted July 23, 20178 yr Hi. I need script for auto reboot/restart server after crash or something like that. I've found one : #!/bin/sh cd /home/minecraft/Kinetic while true do echo "##########STARTING###########" java -server -Xmx3G -Xms3G -jar forge-1.11.2-13.20.0.2366-universal.jar nogui echo "Restarting in:" for i in 5 4 3 2 1 do echo "$i..." sleep 1 done echo "Server Hub Restarting!" done But after I trying to start .sh file via terminal I've got an error: bash: ./start.sh: /bin/bash^M: bad interpreter: No such file or directory If anyone can help with this I gonna be grateful. Edited July 23, 20178 yr by Redock
July 23, 20178 yr Author :/home/minecraft/Kinetic# ./reseter.sh /bin/sh: 0: Can't open cd /home/minecraft/Kinetic \n while true \n do \n echo "##########STARTING###########" \n java -server -Xmx3G -Xms3G Script: #!/bin/sh cd /home/minecraft/Kinetic \n while true \n do \n echo "##########STARTING###########" \n java -server -Xmx3G -Xms3G -jar forge-1.11.2-13.20.0.2366-universal.jar nogui \n echo "Restarting in:" for i in 5 4 3 2 1 \n do \n echo "$i..." \n sleep 1 \n done \n echo "Server Hub Restarting!" \n done
July 23, 20178 yr Author Checked my editor and default coding is for Linux (/n). So my script should work at start.
July 23, 20178 yr Author I checked it and line endings is for Linux /n. So this should work from beginning.
July 23, 20178 yr Try changing shebang to #!/bin/bash Also, if you're using linux, why are you editing in n++? Edited July 23, 20178 yr by MrBendelScrolls
July 23, 20178 yr Author On my pc I've got windows 10, but server is on vps on ubuntu 16.04. That's why I'm using n++. And when I change to bash it's the same error Edited July 23, 20178 yr by Redock
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.