Jump to content

JK2 Restart Script


Recommended Posts

Hi, I've gotten help with a restart script on here before but it was for JKA.. I was wondering if someone could assist me in making one for JK2 (I am a super noob VPS user, so not really help. More like make me one xD) 

 

The one that I had before worked perfectly and logged, but one disadvantage was I couldn't see what was actually happening in the server.

 

I want to be able to see stuff like this if possible: 

 

1b99653ec9.png

 

If not, a regular restart script would be super nice~ 

Thanks!

 

(Btw, ubuntu 12.10 64 bit if it makes a difference) 

Link to comment

#!/bin/bash

echo "Superleet startup script!"

status=1
while [ $status -ne 0 ]
do
./linuxjampded +set dedicated "2" +set fs_game "japlus" +exec "server.cfg" >log.txt 2>&1
status=$?

if [ $status -ne 0 ]
then
date=`/bin/date`
echo "Server crashed with status "$status" at "$date
fi
done

echo "Server exited peacefully"

Link to comment

Sounds like you edited it from Windows, and the program you used added Windows-style line endings.

Try editing it in nano and redoing all the lines (delete, return)

 

It's also a generally bad idea to run things as root or as superuser (sudo) =]

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...