Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2002
    Posts
    446

    shell scripts & ftp

    executing a shell script (to start game server) though FTP. can this be done? i'm using FlashFXP. if someone can suggest a different solution i'm all ears.

  2. #2
    Join Date
    Apr 2001
    Location
    Palm Beach, FL
    Posts
    1,095
    I don't know why you would want to do this, but you can probably use cron to help.

    Create a script that monitors a certain directory for the file "start" -- if it finds it, it starts up the game server and removes the file "start."

    You can even do it with a "stop" file.

    Set the cron to an acceptable frequency for you and then when you're ready to play, upload the file "start" and when you're done upload the file "stop."

    Just an idea...
    Alex Llera
    Professional Server Management
    FreeBSD|Linux|HSphere|Cpanel|Plesk

  3. #3
    Join Date
    Apr 2002
    Posts
    446
    i'm doing it because we do not allow shell access for security reasons. thank you for the suggestion though

  4. #4
    Join Date
    Mar 2001
    Location
    California
    Posts
    332
    How about a web page interface using PHP.

  5. #5
    Join Date
    Apr 2002
    Posts
    446
    do you know a program to do this? if so please give me more info on it.

  6. #6
    Join Date
    Mar 2001
    Location
    California
    Posts
    332
    Searching on freshmeat.net, I found some for controlling game servers, but not for starting one. There is bound to be something out there if you look hard enough.

    PHP is not a difficult language to learn if you have some programming experience. It should not be too difficult to build what you need. Of course there are some serious security concerns you should pay attention to when creating such a utility.

  7. #7
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,978
    I don't know of a ftp program that intentionally allowed execution of arbitrary code.

    You could also use a perl script, or probably even a shell script in your web document directory to start your program.

    Use your FTP program to upload the file (in your cgi-bin directory if you have one) give it execute permission, then go to the URL. Unless your web host provider also doesn't allow CGI.

    A simple script would be named runme.cgi:

    Code:
    #!/bin/sh
    
    command_to_run
    Sure, it's going to give you a Server 500 error, but it should run.
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

  8. #8
    Join Date
    Aug 2002
    Location
    London, UK
    Posts
    9,037
    It would be really easy to do a really simple start stop button in php.. then ht access the dir where this is.. ill do it 2morow if i got time and someone else doesnt already post it.
    Matt Wallis
    United Communications Limited
    High Performance Shared & Reseller | Managed VPS Cloud | Managed Dedicated
    UK www.unitedhosting.co.uk | US www.unitedhosting.com | Since 1998.

  9. #9
    Join Date
    Apr 2002
    Posts
    446
    thank you mark & matt. since i don't know php i'll try the cgi idea and see how that works out. i'll look forward to that lil php matt.

  10. #10
    Join Date
    May 2002
    Posts
    190
    its not that hard making a script to start / stop the server the hard part is making it run as X user dont want all the servers running as nobody
    C Code. C code run. Run, code, run...
    Segmentation fault (core dumped).. aww sh!t

  11. #11
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,978
    Originally posted by Faggle
    its not that hard making a script to start / stop the server the hard part is making it run as X user dont want all the servers running as nobody
    Good point. Unless they're using suexec, you might end up running the program as the same user that the webserver runs as, if you use CGI.
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

Posting Permissions

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