Script Auto Start gs01

Results 1 to 13 of 13
  1. #1
    Enthusiast dokz is offline
    MemberRank
    Dec 2011 Join Date
    43Posts

    smile Script Auto Start gs01

    Someone have a script to open up World (gs01) automatically after falls?

    like open up the world after falls in five minutes?

    thanks


  2. #2
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: Script Auto Start gs01

    This has been posted somewhere. If I run across it again I will link to it, but if you want it a little quicker you may desire to search for it yourself

  3. #3
    Enthusiast dokz is offline
    MemberRank
    Dec 2011 Join Date
    43Posts

    Re: Script Auto Start gs01

    i Found

    /root/daemon-gs01.sh
    Code:
    # - - - - - - BEGIN
    # Sample Daemon Guard for World Map

    #/bin/bash

    if ps ax | grep -v grep | grep 'gs gs01' > /PWServer/logs >> daemon-gs01.log
    then
    echo "Main World [GS01] is RUNNING."
    else
    echo "Main World [GS01] is DOWN!!! Attempting to restart GS01..."
    echo "Starting GS01..."
    cd /PWServer/gamed
    ./gs gs01
    fi

    # - - - - - - END

    /etc/crontab

    Code:
    10 * * * * /root/daemon-gs01.sh

    but... in my host not have the folder crontab in /etc
    and now?

  4. #4
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: Script Auto Start gs01

    crontab is not a directory it is a file

  5. #5
    Enthusiast dokz is offline
    MemberRank
    Dec 2011 Join Date
    43Posts

    Re: Script Auto Start gs01

    no comments... fail for me.... thanks a lot.

    i don't believe this...

  6. #6
    Angelemu founder tbnanubis is offline
    MemberRank
    Mar 2011 Join Date
    Unicorn ForestLocation
    527Posts

    Re: Script Auto Start gs01

    you start the gs in a loop and it will auto restart once it quits

  7. #7
    SON OF MARFEL hrace009 is offline
    MemberRank
    Apr 2009 Join Date
    Pekanbaru, IndoLocation
    1,035Posts

    Re: Script Auto Start gs01

    Quote Originally Posted by dokz View Post
    i Found

    /root/daemon-gs01.sh
    Code:
    # - - - - - - BEGIN
    # Sample Daemon Guard for World Map

    #/bin/bash

    if ps ax | grep -v grep | grep 'gs gs01' > /PWServer/logs >> daemon-gs01.log
    then
    echo "Main World [GS01] is RUNNING."
    else
    echo "Main World [GS01] is DOWN!!! Attempting to restart GS01..."
    echo "Starting GS01..."
    cd /PWServer/gamed
    ./gs gs01
    fi

    # - - - - - - END

    /etc/crontab

    Code:
    10 * * * * /root/daemon-gs01.sh

    but... in my host not have the folder crontab in /etc
    and now?
    learn linux first, then learn developing PW Server

  8. #8
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Script Auto Start gs01

    Quote Originally Posted by tbnanubis View Post
    you start the gs in a loop and it will auto restart once it quits
    I honestly never thought of that...

    Code:
    while [ 1 ]
    do
        ./gs gs01 &> /path/to/logs/gs01.log
    done
    For those to lazy to google how to do an infinite loop in bash...

  9. #9
    Enthusiast dokz is offline
    MemberRank
    Dec 2011 Join Date
    43Posts

    Re: Script Auto Start gs01

    Quote Originally Posted by das7002 View Post
    I honestly never thought of that...

    Code:
    while [ 1 ]
    do
        ./gs gs01 &> /path/to/logs/gs01.log
    done
    For those to lazy to google how to do an infinite loop in bash...
    Das, sorry for this question, the code can be add in start.sh? Because with me, the script posted by romulan not worked =(
    Last edited by dokz; 06-02-12 at 08:11 AM.

  10. #10
    Viva la Vida NaMeLeS is offline
    MemberRank
    Jul 2011 Join Date
    613Posts

    Re: Script Auto Start gs01

    Yes it can be added in start.sh if you want it too ne

  11. #11
    Proficient Member Souris is offline
    MemberRank
    Feb 2009 Join Date
    167Posts

    Re: Script Auto Start gs01

    Alternatively use my advanced instance loader which will do that for you amongst other useful stuff (like keep log if it crashes, avoid hogging the server if it crashes on reload, etc).

    I've even updated it with my latest changes :D

  12. #12
    Member maedagua is offline
    MemberRank
    Dec 2011 Join Date
    56Posts

    Re: Script Auto Start gs01

    I use the following
    Create the file start_map_gs01.sh

    echo "Start gs01"
    cd /PWServer/gamed
    ./gs gs01 >$
    echo "gs01 started"


    Add in crontab
    crontab -e
    0,10,20,30,40,50 * * * * /PWServer/start_map_gs01.sh

    every 10 minutes will be sent the command to turn on the map.

  13. #13
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: Script Auto Start gs01

    You wouldn't want to keep starting it over and over though if it hasn't 'failed' ...



Advertisement