Jump to content

Patrick Brenner

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Patrick Brenner

  1. Greetings, everyone!

    I'm writing a Minecraft startup script for my Ubuntu server box. I mostly do simple Java and C/C++, as I'm only a sophomore in college studying Computer Science: I haven't made it to any other languages yet. Anyways, I'm writing this script in what I believe to be Bash, although the internet sources around this language seem few and far between. Regardless, this is my script:

    #START SCRIPT#

    #!/bin/bash

    ## BEGIN_CONFIG ##

    MC_PATH=/home/pmbrenner91/Minecraft/TekkitLite

    BKUP_PATH=/media/external/minecraft/backup

    SCREEN_NAME="minecraft"

    ## END_CONFIG ##

    if [ -e $MC_PATH/server.log.lck ]

    then

    ONLINE=1

    else

    ONLINE=0

    fi

    display() {

    screen -R $SCREEN_NAME

    }

    server_launch() {

    echo "Starting Minecraft server..."

    cd $MC_PATH

    screen -m -d -S $SCREEN_NAME java -Xmx${MEMALOC}M -Xms${MEMALOC}M -jar TekkitLite.jar nogui

    sleep 5

    }

    server_stop() {

    echo "Stopping Minecraft server..."

    screen -S $SCREEN_NAME -p 0 -X stuff "`printf "stop.\r"`"

    sleep 5

    }

    if [$# -gt 0]

    then

    case $1 in

    ## STATUS ##

    "status")

    if [$ONLINE -eq 1]

    then

    echo "Minecraft server seems ONLINE."

    else

    echo "Minecraft server seems OFFLINE."

    fi;;

    ## START ##

    ## ##

    *)

    echo "Usage : minecraft < status | start [force] | stop | restart [warn] | logs [clean] | backup [clean] | update >";

    esac

    else

    if [$ONLINE -eq 1]

    then

    display

    else

    echo "Minecraft server seems OFFLINE."

    fi

    fi

    exit 0

    #STOP SCRIPT#

    I wrote it using the Notepad++ editor for Windows, and I saved it as a Unix Script File, which enables a file extension of .sh, which I've found to be typical of most programs run using the Linux terminal. So, I try running the file using ./minecraft.sh (the name of the program is minecraft.sh), and I encounter an error saying that I am using a bad interpreter:

    pmbrenner91@SERVER:~/Minecraft/TekkitLite/Server0.6.0$ ./minecraft.sh

    -bash: ./minecraft.sh: /bin/bash^M: bad interpreter: No such file or directory

    So, I run it using <bash minecraft.sh> at which point I receive the following error:

    pmbrenner91@SERVER:~/Minecraft/TekkitLite/Server0.6.0$ bash minecraft.sh

    minecraft.sh: line 13: syntax error near unexpected token `$'{\r''

    'inecraft.sh: line 13: `display(){

    From my understanding, Windows and Unix/Linux parse new lines differently. Apparently, Windows uses CR and LF, or \r \n to signify new lines in a text file. Unix/Linux uses only LF, or \n. But this leaves me confused, as it waits to line 13 to encounter a parse error. Can anyone help a new programmer?

    Thanks a million!

    --PMBrenner91

  2. Azeryn,

    Yeah, I just wanted to provide as much background information as I could, but I do agree that it sounds very confusing the way that I put it.

    Anyways, I loaded up 0.5.2 just fine. It played fine. But it's not compatible with 0.5.3 servers. So I tried installing 0.5.3. It downloaded and started up fine, but looking in the bottom left corner at the main screen when it starts up, it says only 3 mod packs loaded. It didn't download all the mod packs. Which is so confusing. I have no idea what's going on.

    --PMBrenner91

  3. Greetings everyone!

    I just had Windows 8 on my computer, but my experience with it was awful, so I reinstalled Windows 7 this afternoon. I installed all of the proper drivers, and anti-virus software, Chrome, and all that jazz. Now on to Tekkit Lite.

    I've had no problem with the Technic Launcher in the past, but for some reason, when I try to set the launcher to "Always use development builds", it won't download properly. In the grayed out box, it lists "0.5.3|1.4.7|Latest". But when I login from the primary menu, it won't download any of the mod packs. But TekkitLite will still start.

    However, on the main menu, it says that only three mod packs are downloaded and installed. Does anyone else have this same issue? Or any solutions to manually download the latest version of TekkitLite? Thanks!

    Cheers,

    PMBrenner91

×
×
  • Create New...