ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.