Jump to content

Haulvarn

Members
  • Posts

    4
  • Joined

  • Last visited

Haulvarn's Achievements

Dirt

Dirt (1/9)

0

Reputation

  1. I'm afraid I never used Screen, and so I can't tell you what you need to do to get it working... however, you shouldn't have to explicitly start the shell by writing 'bash MCPCStarter.sh', just 'MCPCStarter.sh' should work aswell. If I understand Screen correctly however, you first need to create a new session, then connect to that session, and just execute the shell. After that you disconnect form the session (I think ). Anyway, glad to hear that you got the script running
  2. hmmm... very strange... I took your code, executed it, and this is what I got: ' $ ./test2.sh 0 /cygdrive/c/app 1 3 Error: Unable to access jarfile mcpc-plus-1.6.4-R2.1-forge965-B243.jar Server shutting down in 3 seconds! Server shutting down in 2 seconds! Server shutting down in 1 second! Shutdown.. ' so it seems to be working properly... A collegue of mine just had an idea though: Apparently some versions of linux and/or unix don't support the 'true' keyword. Maybe try replacing it with '[ 0 -eq 0 ]', that should have the same effect. EDIT: Another idea would be, that you have windows linebreaks in your file. Try replacing 'rn' with 'n' for the entire file. EDIT2: Another idea from a colegue is that you might not have bash, but only shell which might not support some of the commands. try executing this: 'ls -la /bin/sh /bin/bash'. if it doesn't return a line for bin/bash, then you might want to install it. Maybe also execute this '/bin/sh --version' to check what shell version you're running. If none of the above help, then you linux system and version might help us find the solution.
  3. ok, so basically what this '$(dirname "$(readlink -fn "$0")")' does is, that it returns the path of the shell file, without the filename. if you started './testfolder/test.sh' then MC_PATH would contain './testfolder/'. You can't just replace 'dirname' without removing the stuff after it, because dirname is a function that works with the returnvalue of readlink. Replacing it with 7sanctums doesn't work, because it isn't a function. Edit: you also need to remove the $ before, and the brackets around it, because that initiates the execution of a function You should however be able to replace '$(dirname "$(readlink -fn "$0")")' with your path though. Not sure if it had to be in single quotes, double quotes or no quotes at all though, but that should be easy to find out by trying, or asking google (I might try it a bit later). As for the 'No such file or directory' error: Again, I can't try it with the actuall server files, as I'm not at home, but I tried placing an empty file called server.properties in my script folder, and it worked. there was no error. Here's one thing you can try though: after the 'MC_PATH=$(dirname "$(readlink -fn "$0")")' you insert a new line 'echo $MC_PATH'. now when you execute the script it shows you the path it's using, and expecting the server files to be in. Hope this helps you.
  4. Hi there I'm new to linux too, but I like to have a look at all sorts of shell scripts, and like to understand them. If I get this right, then the MC_PATH variable contains the path of the shell script file. So I think you have to place it in the Minecraft Server Folder. I'm not at home right now though, so this is only guessing since I can't try it. Did you place the shell file in the minecraft folder? If you did, and it didn't help, then maybe a qucik excerpt of your changes might help. cheers Edit: I just tested it. Works for me, but I don't have the .jar file it tries to start, so i get an error there of course.
×
×
  • Create New...