Results 1 to 10 of 39

Thread: [CoD2] Install CoD2 on your VDS much faster!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Time to pick apart a git repo. Note that I like the idea of this stuff, but there's a lot of stuff that could be done better script-wise:


    First off, I wouldn't chmod files to 777 unless they need to be executeable by everyone. Chmod 500 works fine for almost all intents and purposes.

    You seem to not apt-get update after adding the i386 architecture. This will (probably) cause subsequent apt-gets to fail.

    The gcc-multilib is no longer required by voron's libcod if I recall correctly

    What are you using zram-config for?

    You're using a hard-coded path for the noip folder. If they update (and increase the version number) your script will no longer work. Try cd noip*

    You're not cleaning up the downloaded .tar file for the noip install

    Why do you need mysql-server and php5-cgi just for installing a web server, which is most likely going to be used for redirect stuff?

    You don't seem to be setting the owner or file permissions on the php.ini file when overwriting the old one

    The linking of the phpmyadmin can fail in case such a directory and/or link already exists. Use -f for ln to force the link to be created regardless (might cause dataloss if there's a phpmyadmin folder with files in it already though)

    You're completely removing the apache2 program during the installation, without informing the user about it. Worse, you remove it and its config files, which are most likely custom (apt-get purge)

    Why is the new cod2 user granted sudo privileges? I'd put my cod2-specific accounts without sudo privileges for obvious reasons

    There's probably no need to specify the base dir (-b /home) in your useradd command

    If all you want to do is add a user with a password, use adduser instead of useradd. It will prompt the user to input a password as well, so you don't have to manually call passwd afterwards

    You're assuming that the user has the cod2install folder in his home dir (like /root/cod2install). This will not always be the case. Better to just copy all contents of current dir to the new folder

    No need to chmod those files to 777 again. 500 would suffice for read+execute privileges. (when cloning git repos the correct chmod settings are already applied. These are determined at git-commit time, so whatever permissions you upload get downloaded anyway)

    You're trying to execute the cod2_servers.sh from the original location. This might fail if this original user is root, and the user has no read-rights on the root dir (default situation). Better to use the /home/$user/ stuff for that. (I am not 100% sure this will happen, but better safe than sorry)

    Your description for last localized file only seems off for 1.2. I recall 1.2 missing the last localized file, causing the server to message PC_PATCH_CLIENTDOWNLOADDISCONNECTED on a few occasions. 1.2 should only differ in iw_15.iwd compared to 1.0

    The link included in the git project seems already dead. Reporting it per comments.

    For linking all contents of a directory, you can more easily just do ln -s /source/*.iwd /dest/ No need to use a for loop there.

    Please keep in mind that copying the pb folder will automatically enable your punkbuster. The sv_pb cvar does not influence this for some strange reason. You might want to add a separate question for it.

    You're limiting users to one server per fs_game. Users cannot run multiple servers from the same (named) fs_game folder due to the .sh file being named after the fs_game.

    There's no input checking on port or cracked cvars

    There's no need to set sv_version afaik

    You might want to add a wait/sleep in the while loop that's restarting the server. Otherwise, a bug in the mod might completely trash all server resources

    You probably want to chmod the resulting fs_game.sh files to 500 so they can actually be executed.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  2. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (3rd May 2017),Lonsofore (3rd May 2017)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •