Jump to content

Home

How to...


Sneaky G

Recommended Posts

Hi All

 

I have followed all the read me instructions on setting up a Linux server

 

The only problem is I don't know how to execute the batch file on the server.

 

I am pretty new at this so any help would be very much appreciated

 

Thanks

 

Gary

Link to comment
Share on other sites

No "batch" file for linux.

 

You can create a shell script for it though. Here is an example that should work :

 

#!/bin/sh

 

cd /usr/games/jk2

./jk2ded +set bot_enable 0 +set sv_pure 1 +set dedicated 2 +set g_gametype 3 +exec server.cfg

 

chmod the file to be executable and you should be ok.

 

Here is an example if you're using screen :

 

#!/bin/sh

 

cd /usr/games/jk2

/bin/screen -A -m -d -S jk2server su jk2 -c '/usr/games/jk2/jk2ded +set bot_enable 0 +set sv_pure 1 +set dedicated 2 +set g_gametype 3 +exec server.cfg'

 

 

 

note this specifies jk2 as the user running the process so make sure you either change it or make a jk2 user.

Link to comment
Share on other sites

Ok, then you're not going to use a batch file to start your server, you'll use a script. I remember reading before that you had used the path /mkdir/usr/local/games/jk2? mkdir is the command to make a directory. However, you can use that path if you wish. Let's make sure you have everything you need. Inside the jk2 folder (wherever it is) you should, at a minimum, have the following:

 

jk2ded

base (folder)

^-- assets0.pk3 assets1.pk3 server.cfg

 

You will need to edit the server.cfg depending on what kind of server you want to run. In the most basic form, this is what you'd type to start the server (assuming you are in the directory with the jk2ded file):

 

./jk2ded +set dedicated 2 +exec server.cfg

 

That's if you want a dedicated internet server (2), as opposed to a LAN server (1) or a listen server (0). When you type the above, a bunch of things will scroll by and you'll be in the console. You can verify that the server is running by typing:

 

status

 

It should look something like this:

 

status

map: ffa_bespin

num score ping name lastmsg address qport rate

--- ----- ---- --------------- ------- --------------------- ----- -----

 

If, instead, it says "server not running", then you didn't start a map in your server.cfg. You can fix that (temporarily) by typing:

 

map ffa_bespin

 

You can stop the server by typing:

 

quit

 

..at which point you should be returned to a prompt. I'd go ahead and give that a quick go to make sure that everything works at the basic level before we go too much further into how to configure your server or how to run the server as a job or inside screen so that you can move in and out of the console at will.

Link to comment
Share on other sites

Thanks MatrixCPA & Novus

 

I have set all the directories and files up (I think).

 

I am still unsure how I execute the './jk2ded +set dedicated 2 +exec server.cfg' command.

 

I access my web server though a control panel supplied by the web hosting company or SmartFTP

 

Can I use on of these to run it?

 

Thanks again

Link to comment
Share on other sites

Well, that would be a problem. To really run the server, you'll need telnet/ssh access to the box. Does the provider understand that you're using this as a game server or do they just think you're using it as a web/ftp server? You might want to make sure that running a game server doesn't violate your TOS agreement. If it doesn't, then you're going to need someone who does have either direct access to the box or telnet/ssh access to startup the server for you. Of course, you'd be wise to put an auto-restart script in place. Otherwise, you'll have to call them every time it crashes....which can be often.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...