Jump to content

JK2 Restart Script


Recommended Posts

Posted

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) 

Posted

not sure why JK2 matters, they use the same restart script for both JK2 and JKA

 

I want one where I can still view everything going on in the server. The one that I do use just prints a message. 

Posted

#!/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"

Posted

Hah, I think I wrote that one ages ago.

It should work fine, and it's intended to be run in a screen session.

Try removing the 2>&1 part

Posted

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) =]

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...