Jump to content

sturm105

Members
  • Posts

    10
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by sturm105

  1. ScriptDev2 patch for 7812 is on the SD2 SVN. Should work now. However, I'm getting an error when using "git pull" to update my mangos file. It says

    You asked me to pull without telling me which branch you
    want to merge with, and 'branch..merge' in
    your configuration file does not tell me either.  Please
    name which branch you want to merge on the command line and
    try again (e.g. 'git pull <repository> <refspec>').
    See git-pull(1) for details on the refspec.
    
    If you often merge with the same branch, you may want to
    configure the following variables in your configuration
    file:
    
       branch..remote = <nickname>
       branch..merge = <remote-ref>
       remote.<nickname>.url = <url>
       remote.<nickname>.fetch = <refspec>
    
    See git-config(1) for details.
    

    Git is far more confusing than subversion.

  2. Some suggestions:

    - you aren't sending the process to the background, so there is no need for the if statement (which itself is also broken since the grep will see itself in the processlist and return true)

    - shell scripts should generally have a .sh suffix

    - the shebang is missing

    - please use "while true" or "while :" instead of "while date" (date will generally return 0 so it will work. but it just doesn't make sense since the the loop isn't critically based on a working date binary ;), would be a shame if mangos doesn't start just because someone broke "date")

    if all you want is a simple restarter that logs when it restarted, your script wound look fine like this:

    #!/bin/bash
    
    Daemon="worldd"
    
    BinDir="/opt/MaNGOS/bin/"
    LogDir="/opt/MaNGOS/log/"
    
    if [[ $(ps -o command= -ae|egrep -c "[m]angos-${Daemon}") -gt 0 ]]
    then
      echo "mangos-${Daemon} is already running, exiting"
    exit 1
    fi
    
    ######### End of Config ##########
    
    while true 
    do # loop forever
      echo "(re)starting server at $(date +"%m-%d-%H:%M-%S")>> ${LogDir}${Daemon}_restart_log.txt
    nice -n 20 ${BinDir}mangos-${Daemon}
    sleep 5
    done
    

    checking for running processes works a bit better if you have mangos configured to write pidfiles, then you just have to check if the pid in the file is actually running (e.g. by checking /proc/$pid/cmdline)

    Question: are all shell scripts in Linux used with the .sh suffix? Or are there other ones I should know about?
  3. I'm currently using MaNGOS on my Mac, and every time I want to launch it I have to open up two iTerm windows and cd to the folder, then launch the applications. It's really a trivial task, but I think it would be better if I wrote a script to do it for me. I couldn't figure out where to start, so I thought maybe one of you had one already. If you don't, we could write one together! Here's the commands I need it to execute (in this order.):

    Open a session (in iTerm)
    "cd /opt/mangos/bin/"
    "./mangos-realmd"
    Open a second session in the same window as a new tab
    "cd /opt/mangos/bin/"
    "./mangos-worldd"

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use