SRCDS Steam group


Remote Reboot / Shut Down Scripts
#16
Now I have multiple scrds servers on my box and need one for each server, what key parts would I need to change, besides the path, to have the scripts functioning properly?
Reply
#17
Code:
<?php

/*
Simple SRCDS startup script
¦ Jean-Philippe Caissy
¦ Game servers by gamers, for gamers
¦ Offering CS and CS:S Servers at a great low price
¦ www.puppyservers.com

2009/04/24
*/

$path = "/home/rpgaming/*****"; //Path to srcds_run
$exec = "srcds_run"; //Either srcds_amd or srcds_i686 or srcds_i486

switch($_GET['action']) {
    case "start":
        exec("cd ".$path." && export LD_LIBRARY_PATH=\".:bin:\$LD_LIBRARY_PATH\" && nice -20 ./".$exec." -game cstrike -ip ******* -port 27015 -maxplayers 48 -tickrate 100 +fps_max 500 +map cs_crackhouse +servercfgfile server.cfg -autoupdate -pidfile scrcds_crackhouse.pid  2>&1 &");
    break;
    case "stop":
        exec("kill `cat ".$path."/scrcds_crackhouse.pid`");
        exec("rm ".$path."/scrcds_crackhouse");
    break;
    case "forcestart":
        exec("kill -9 `cat ".$path."/scrcds_crackhouse`");
        exec("rm ".$path."/scrcds_crackhouse.pid");
    break;    
    case "status":
        if(!file_exists($path."/scrcds_crackhouse.pid")) {
                return 0;
            } else {
                exec("ps -p `cat ".$path."/scrcds_crackhouse.pid`", $output);
                if(count($output) > 2)
                    return "An unknown error has occured, we got more than 2 process!";
                if(count($output) === 1)
                    return 0;
                else
                    return 1;
            }
            //returns 1 if server is running
    break;    
}

?>

This is my coding, it doesn't seem to be doing any moves. I have the server running in a screen right now, but also restarted the server with the pid file name i chose above. Where I have srcds_run, i tried the srcds_i686 and have no dice.
Reply
#18
kilogames Wrote:
Code:
<?php

/*
Simple SRCDS startup script
¦ Jean-Philippe Caissy
¦ Game servers by gamers, for gamers
¦ Offering CS and CS:S Servers at a great low price
¦ www.puppyservers.com

2009/04/24
*/

$path = "/home/rpgaming/*****"; //Path to srcds_run
$exec = "srcds_run"; //Either srcds_amd or srcds_i686 or srcds_i486

switch($_GET['action']) {
    case "start":
        exec("cd ".$path." && export LD_LIBRARY_PATH=\".:bin:\$LD_LIBRARY_PATH\" && nice -20 ./".$exec." -game cstrike -ip ******* -port 27015 -maxplayers 48 -tickrate 100 +fps_max 500 +map cs_crackhouse +servercfgfile server.cfg -autoupdate -pidfile scrcds_crackhouse.pid  2>&1 &");
    break;
    case "stop":
        exec("kill `cat ".$path."/scrcds_crackhouse.pid`");
        exec("rm ".$path."/scrcds_crackhouse");
    break;
    case "forcestart":
        exec("kill -9 `cat ".$path."/scrcds_crackhouse`");
        exec("rm ".$path."/scrcds_crackhouse.pid");
    break;    
    case "status":
        if(!file_exists($path."/scrcds_crackhouse.pid")) {
                return 0;
            } else {
                exec("ps -p `cat ".$path."/scrcds_crackhouse.pid`", $output);
                if(count($output) > 2)
                    return "An unknown error has occured, we got more than 2 process!";
                if(count($output) === 1)
                    return 0;
                else
                    return 1;
            }
            //returns 1 if server is running
    break;    
}

?>

This is my coding, it doesn't seem to be doing any moves. I have the server running in a screen right now, but also restarted the server with the pid file name i chose above. Where I have srcds_run, i tried the srcds_i686 and have no dice.

My code does not create any screen. Also you have +maxplayers 48 ... is it possible??

Try it on a clean install of srcds
Jean-Philippe | Puppy Servers
Game servers by gamers, for gamers
Offering CS and CS:S Servers at a great low price
www.puppyservers.com
Reply
#19
jpcaissy Wrote:
kilogames Wrote:
Code:
<?php

/*
Simple SRCDS startup script
¦ Jean-Philippe Caissy
¦ Game servers by gamers, for gamers
¦ Offering CS and CS:S Servers at a great low price
¦ www.puppyservers.com

2009/04/24
*/

$path = "/home/rpgaming/*****"; //Path to srcds_run
$exec = "srcds_run"; //Either srcds_amd or srcds_i686 or srcds_i486

switch($_GET['action']) {
    case "start":
        exec("cd ".$path." && export LD_LIBRARY_PATH=\".:bin:\$LD_LIBRARY_PATH\" && nice -20 ./".$exec." -game cstrike -ip ******* -port 27015 -maxplayers 48 -tickrate 100 +fps_max 500 +map cs_crackhouse +servercfgfile server.cfg -autoupdate -pidfile scrcds_crackhouse.pid  2>&1 &");
    break;
    case "stop":
        exec("kill `cat ".$path."/scrcds_crackhouse.pid`");
        exec("rm ".$path."/scrcds_crackhouse");
    break;
    case "forcestart":
        exec("kill -9 `cat ".$path."/scrcds_crackhouse`");
        exec("rm ".$path."/scrcds_crackhouse.pid");
    break;    
    case "status":
        if(!file_exists($path."/scrcds_crackhouse.pid")) {
                return 0;
            } else {
                exec("ps -p `cat ".$path."/scrcds_crackhouse.pid`", $output);
                if(count($output) > 2)
                    return "An unknown error has occured, we got more than 2 process!";
                if(count($output) === 1)
                    return 0;
                else
                    return 1;
            }
            //returns 1 if server is running
    break;    
}

?>

This is my coding, it doesn't seem to be doing any moves. I have the server running in a screen right now, but also restarted the server with the pid file name i chose above. Where I have srcds_run, i tried the srcds_i686 and have no dice.

My code does not create any screen. Also you have +maxplayers 48 ... is it possible??

Try it on a clean install of srcds

Screens are essential. I will take a look and see how I can modify it. I log into my server often with my phone and do work on these servers.
Reply
#20
Yeah no luck.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)