LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2005, 08:53 AM   #1
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Call of Duty 1.4 Dedicated Linux Server Script


The other week I wanted to install a Call of Duty dedicated linux server, so i set about making and install script to help make loading it on other machines a lot easier, and also so I don't have to keep going over the same thing over and over.

All you need is to download the Call of Duty dedicated linux binaries (large) approx 180 mb, extract the tar file, then copy my script to the main directory of the extracted binaries. The script will create the directories, install the binaries files to the right directories and install all data files required from both retail cd's. For the server to run you will need to configure the server.cfg and map_rotation files for the server to function.

I've made it for install from either mandrake 10 official and Suse 9.2, it may also work for other distros, I just don't know how the other distro setup their cdroms. I'm not a programmer, or know anything about scripting, but I thought I would post this script since it was my first, others may find it useful as well.

I would like to make the script a bit more professional, like being able to check for the right cd before installing, and maybe even a nice little GUI for the installation, maybe someone could lend some advice or point me in the direction of some good reference material.


#!/bin/bash
osch=0

echo ""
echo ""
echo "1. Mandrake 10.0 Official Release"
echo "2. Suse 9.2"
echo ""
echo -n "Select your os choice and then hit the Enter Key [1 or 2]? "
echo ""
read osch

if [ $osch -eq 1 ] ; then

echo ""
echo ""
echo ""
echo "This Will Install A Call of Duty Dedicated 1.4 Linux Server"
echo ""
echo "On Mandrake 10.0 Official Release"
echo ""
echo "This may also work on ealier versions of Mandrake"
echo ""
echo -n "Press the enter key to continue."
echo ""
echo ""
read
# Make the game directory
mkdir /usr/local/games/codserver


# This will copy all the files required for the server
# Call of Duty Disc 1
umount /dev/cdrom /mnt/cdrom
eject /mnt/cdrom
echo ""
echo ""
echo "Please Insert Call of Duty Disc 1"
echo ""
echo -n "Press the enter key to continue."
echo ""
echo ""
read
eject -t /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/Setup/Data -rfv /usr/local/games/codserver


# This will copy all the files required for the server
# Call of Duty Disc 2
umount /dev/cdrom /mnt/cdrom
eject /mnt/cdrom
echo ""
echo ""
echo "Please Insert Call of Duty Disc 2"
echo ""
echo -n "Press the enter key to continue."
echo ""
echo ""
read
eject -t /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/Setup/Data -rfv /usr/local/games/codserver

echo ""
echo ""
echo "Installing Linux Binaries"
echo ""
echo ""

cp -rfv languages /usr/local/games/codserver
cp -rfv pb /usr/local/games/codserver
cp -rfv main /usr/local/games/codserver
cp -rfv cod_lnxded /usr/local/games/codserver


umount /dev/cdrom /mnt/cdrom
eject /mnt/cdrom
echo ""
echo ""
echo "Call of Duty Dedicated 1.4 Linux Server"
echo ""
echo "Successfuly Installed"
echo ""
echo -n "Please remove your CD-ROM and Press the enter key"
echo ""
echo ""
read
eject -t /mnt/cdrom


else

if [ $osch -eq 2 ] ; then


echo ""
echo ""
echo ""
echo "This Will Install A Call of Duty Dedicated 1.4 Linux Server"
echo ""
echo "On Suse 9.2 This may also work on ealier versions of Suse"
echo ""
echo "This may also work on ealier versions of Suse"
echo ""
echo -n "Press the enter key to continue."
echo ""
echo ""
read
# Make the game directory
mkdir /usr/local/games/codserver


# This will copy all the files required for the server
# Call of Duty Disc 1
umount /dev/cdrecorder /media/cdrecorder
eject /media/cdrecorder
echo ""
echo ""
echo "Please Insert Call of Duty Disc 1"
echo ""
echo -n "Press the enter key to continue."
echo ""
echo ""
read
eject -t /media/cdrecorder
mount /dev/cdrecorder /media/cdrecorder
cp /media/cdrecorder/Setup/Data -rfv /usr/local/games/codserver


# This will copy all the files required for the server
# Soldier of Fortune 2 Disc 2
umount /dev/cdrecorder /media/cdrecorder
eject /media/cdrecorder
echo ""
echo ""
echo "Please insert Call of Duty Disc 2"
echo ""
echo -n "Press the enter key to continue."
echo ""
echo ""
read
eject -t /media/cdrecorder
mount /dev/cdrecorder /media/cdrecorder
cp /media/cdrecorder/Setup/Data -rfv /usr/local/games/codserver

echo ""
echo ""
echo "Installing Linux Binaries"
echo ""
echo ""

cp -rfv languages /usr/local/games/codserver
cp -rfv pb /usr/local/games/codserver
cp -rfv main /usr/local/games/codserver
cp -rfv cod_lnxded /usr/local/games/codserver


umount /dev/cdrecorder /media/cdrecorder
eject /media/cdrecorder
echo ""
echo ""
echo "Call of Duty Dedicated 1.4 Linux Server"
echo ""
echo "Successfuly Installed"
echo ""
echo -n "Please remove your CD-ROM and Press the enter key"
echo ""
echo ""
read
eject -t /media/cdrecorder


fi
fi
 
Old 01-04-2005, 05:42 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
try using the 'select' command for user choices.
(see man select bash or ksh)

also, IMHO lots of echo's looks untidy,
maybe:

Code:
cat <<EOF

lots 
of lines
of stuff

EOF
a bit neater maybe?

as for checking CD, is there an info file on it you can check
like a file called disk1 or something?

GUI would be a job for TCL or python maybe.


regards billy
 
Old 01-05-2005, 03:29 AM   #3
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Original Poster
Rep: Reputation: 62
Yeah lots of echos, does need to be tidier. Thanks for the tips.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Call Of Duty Server - Path Problem? Crashed_Again Linux - Games 0 06-02-2005 05:52 AM
Help with Call of duty CoDGangster Linux - Games 1 12-09-2004 07:58 PM
playing games like far cry/call of duty on linux mandrake 10??? steve1980 Linux - Newbie 5 09-14-2004 01:45 PM
call of duty g33k Linux - Games 6 02-03-2004 01:04 AM
new Call of Duty Patch for linux!!!!!!! jamil5454 Linux - Software 0 12-30-2003 05:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration