![]() |
![]() |
|
|
|
#1
|
|||
|
|||
|
Hello all,
I have created a Killing Floor Linux installer script to make it easy to install a Linux dedicated server You can see the instructions on my site http://danielgibbs.co.uk/?p=293 Hope this makes it a lot easier to install a server. **Updated 31/7/12** I have made a few fixes and changes based on feedback. This should fix any of the major issues highlighted. Thanks to everyone who provided feedback. If you spot anymore bugs let me know.
Last edited by dgibbs; 07-31-2012 at 05:27 PM. |
|
#2
|
|||
|
|||
|
It's worth securing the guard.txt and install.txt file before putting a password into them.
Code:
touch guard.txt chmod 0600 guard.txt echo "login $USERNAME $PASSWORD" >> guard.txt Can you assume wget and tar are installed? Might be worth checking they exist in the script and complain to the user before starting the download. Possible consider doing an md5sum to make sure the file you have downloaded is the correct one. If I have downloaded steamcmd.tar.gz and placed it inside the directory steamcmd, but haven't untarred it then your script will fail. I think you need to run STEAMEXE=steamcmd ./steam.sh with no options to update itself before being able to run the installation command. You may want to test with a clean account. You use: Code:
cat << ! stuff ! Consider this too: Code:
cat > foo <<% bar % Code:
STEAMEXE=steamcmd ./steam.sh +login ${USER} ${PASSWORD} +force_install_dir ../killingfloor +app_update 215360 validate +quit
Although I prefer putting the password into a file and running that as script since another user can easily get the password from the process list if specified as a command parameter. Although at the moment another user can read the password out of the file. Assume people want to keep their password secure even if you don't care with a throw away account. They might be using their own account with all their games in it on a shared server. You've assumed guard.txt and install.txt are empty. Having the first redirect as '>' rather than '>>' will overwrite whatever is in the file. You've assumed /bin/bash is installed on the system. Some systems have /bin/sh pointing at /bin/dash, therefore /bin/bash does not exist. I've not noticed any bashisms so possibly #!/bin/sh would be better. echo -n is not portable but that's probably not an issue. I've also sent you a private message. |
|
#3
|
||||
|
||||
|
1. Avoid variables written with capital letters, you can shadow already existing variables.
2. There is no check if the wget downloads a file properly, nor if the tar command is successful. 3. You don't check if steam.sh is executable by the user 4. No checks of the ARCH, in example user may be missing ia32 libs so any steam command will probably end with error. 5. Other issues already described by djw in the upper post. Nice try, but can be done better
Last edited by _KaszpiR_; 07-24-2012 at 10:38 AM. |
|
#4
|
|||
|
|||
|
Thank you so much for you feedback. I really appreciate it. I'm still learning bash and am a bit of a newbie when it comes to this stuff. I have kinda just picked up stuff as I go. I will look at implamenting some of your suggestions as im sure it will help me improve
.I also have a script im creating to start, stop, update, monitor and compress maps. It works pretty well currently but I want to be happy with this one before I release that in to the wild. Thanks again for your feedback ![]() I have already today got the steam guard working correctly (I hope) and made a few other minor changes. Last edited by dgibbs; 07-24-2012 at 04:42 PM. |
|
#5
|
||||
|
||||
|
Quote:
Quote:
![]() Looks like is forgot to add chmod +x steam.sh. Fixed this Quote:
Quote:
|
|
#6
|
||||
|
||||
|
1. imagine your script is executed by another script that already has USERNAME defined
then your variabe will destroy the original varialble. 2. I got nice working game server script that can start/stop game on screen and uses qstat/quakestat to check if server is up, so you can add to cron it to restart server on crash. I'll be expanding it soon with some extra features like: backup update logrorate demo compression content rsync to use with www file hosting Last edited by _KaszpiR_; 07-25-2012 at 06:11 AM. |
|
#7
|
|||||||||
|
|||||||||
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
![]() You've assumed /bin/bash is installed on the system. Some systems have /bin/sh pointing at /bin/dash, therefore /bin/bash does not exist. I've not noticed any bashisms so possibly #!/bin/sh would be better. echo -n is not portable but that's probably not an issue. [/QUOTE] I thought bash was on pretty much everything. I have used #!/bin/bash at work on old and new systems and got good results where as using #!/bin/sh was unpredictable whats why I picked bash. |
|
#8
|
|||||
|
|||||
|
Quote:
Code:
test -e `which wget` echo $? Quote:
Quote:
You'll find lots of good bash information at: http://mywiki.wooledge.org/BashGuide Quote:
Quote:
That's just what I was looking for
|
|
#9
|
|||
|
|||
|
qstat/quakestat sounds interesting. I looked it up briefly but did get much info on it. Im currently designing a simular script to monitor the servers and update them etc.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|