#Shell script startup commands

22 messages · Page 1 of 1 (latest)

elfin glade
#

Well I had a whole message here, but apparently it's gone now.

tl;dr while I try to retype it up is that I'm trying to run some commands in a shell script for minecraft but they're acting strange

  • shell script can create directories
  • shell script can delete directories that itself created
  • shell script cannot delete any directories that were created in the Panel webUI or were created by the minecraft server
#

What I want to happen

  1. Click start button
  2. Some world directories get deleted
  3. Minecraft server starts
#

What I did
I created a shell script and placed it in /home/container
I set the startup command to be the above shell script

#

What works
The shell script can make directories
The shell script can delete directories it previously created
The shell script can start Minecraft

#

What doesn't work
The shell script cannot delete any directory that itself did not create

safe marshBOT
#

Please explain the issue you're experiencing in as much detail as possible. Preferably with error messages in a text format or paste link to logs. Nobody can assist you without information that helps to understand the issue. Help us help you. Messages such as "doesn't work" or "i need help" will most likely be ignored.

elfin glade
#

As far as I can tell the directories created by the script or by myself in the Panel webUI all have the same mode bits (owner/group is both 998 for all directories) and are all 755

hexed cypress
#

we give no support for scripts as a startup, as there user editable and are bad for security

just put it all in the startup cmd of the egg as it is just a bash oneliner

elfin glade
#

I tried that first, but that entirely didn't work. It would delete the directories but then wouldn't start minecraft

hexed cypress
#

you can fine removed dir as long as no user interaction is needed to -rf will be needed

elfin glade
#

I guess it won't let me paste code snippets

#

I tried setting the startup command to remove dir1 && remove dir2 && java start minecraft

hexed cypress
elfin glade
#

the sleep was earlier testing ... I've tried without it as well

hexed cypress
# elfin glade

that is fine, please use the new flag we use for max memory and not hardcoding it

elfin glade
#

will do .... the server owner set it that way

hexed cypress
# elfin glade

this looks fine, it will remove those dir and then start the server

you can try replaceing the && with ; then the previous command need to sucseed before it goos one

elfin glade
#

I don't know if I'm just looking in the wrong place, but Paper doesn't have a memory setting field

#

Using the semicolons doesn't work .... the directories weren't deleted and it hangs at the same point as it does with &&

safe marshBOT
#

Please explain the issue you're experiencing in as much detail as possible. Preferably with error messages in a text format or paste link to logs. Nobody can assist you without information that helps to understand the issue. Help us help you. Messages such as "doesn't work" or "i need help" will most likely be ignored.

elfin glade
#

Here is the command that didn't work, and another version without the minecraft start string. (It successfully deletes the directories)