I need to convert this windows bat code, to linux code

Discussion in 'Bukkit Help' started by Gladius_Crafter, Aug 30, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Gladius_Crafter

    Hey guys I am making a hunger games server, but I need this windows batch file to be changed into a linux file.

    @ECHO OFF
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    :start
    java -Xincgc -Xmx1G -jar craftbukkit.jar
    rmdir /s /q "\world\"
    goto start
    PAUSE


    thanks :)
     
  2. Offline

    Omnitv

  3. Offline

    Zinotia

    Just go to the folder which The craftbukkit.jar is at in terminal and type
    java -jar craftbukkit.jar
    That SHOULD work, if not go through the link that Omnitv posted above ^^

    Let me know if you need more help
     
  4. Offline

    Gladius_Crafter

    That script is for my hunger games server, I need it , java -jar craftbukkit.jar only starts the server. I need that exact script for linux.. I need help fast guys.
     
  5. Offline

    bastion

    There is this really neat invention called google that has all sorts of information on how to do stuff. You should try it sometime.
     
    Omnitv likes this.
  6. Offline

    Gladius_Crafter

    Theres something called asking if you have tried searching it instead of being a douchebag. I have tried searching it, and I cannot find it -_-
     
  7. Offline

    bastion

    Not being a douchebag, here is the first result for "shell script"

    http://www.freeos.com/guides/lsst/
     
  8. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    So you need a script that starts the server and on shutdown deletes the world dir?
     
  9. Offline

    Gladius_Crafter

    Yes :)
     
  10. Offline

    electronicboy

    Code:
    #!/bin/bash
    while true;
    do
        java -Xincgc -Xmx1G -jar craftbukkit.jar;
        sleep 5;
        rm -rf world/
        echo 'server will reboot in 20 seconds! Press CTRL-C to stop the reboot, and kill the script!'
        sleep 20; 
    done
    
    This script will also reboot the server upon stop!
    run the script in a screen! upon issueing STOP, the server will stop, the world folder will be removed, and you will be given 20 seconds (easily changed), to stop the server from running!
     
Thread Status:
Not open for further replies.

Share This Page