Restart Script Linux

Hi I am trying to use this:

#!/bin/sh
while true
do
java -server -Xms10G -Xmx12G -jar spongevanilla-1.12.2-7.1.0-BETA-116.jar
echo “If you want to completely stop the server process now, press Ctrl+C before the time is up!”
echo “Rebooting in:”
for i in 5 4 3 2 1
do
echo “$i…”
sleep 1
done
echo “Rebooting now!”
done

But I receive this:
bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or directory

The same file worked a month ago. I am not a Linux/Debian pro.
Can someone help me?

Probably this: https://stackoverflow.com/a/2920431

Maybe try that command if it exists or try editing the file on a Linux machine and then re-save it. You might also want to try the other given answers on stackoverflow.

Edit: Or maybe your text editor has something like Line Endings -> Unix.

2 Likes

Thank you!:grinning: