Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ServerStart.sh is not POSIX (sh) compliant #190

Open
1 of 8 tasks
rrama opened this issue Sep 10, 2024 · 0 comments
Open
1 of 8 tasks

[Bug]: ServerStart.sh is not POSIX (sh) compliant #190

rrama opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rrama
Copy link

rrama commented Sep 10, 2024

General Info

  • I can reproduce this issue consistently in single-player
  • I can reproduce this issue consistently in multi-player
  • I have searched for this issue previously and it was either (1) not previously reported, or (2) previously fixed and I am having the same problem.
  • I am crashing and can provide my crash report(s)
  • I am using the latest version of the modpack

Modpack version

1.0.7

Java version

N/A

Modpack Launcher Used

N/A (Server)

Memory Allocated

N/A

Minecraft World Environment

Server

Misc Client Info

  • Optifine Installed
  • Shaders Installed

Server Java Version

1.0.7

Server Operating System

Linux

Misc Server Info

  • Sponge or Non-Vanilla Forge Server

Issue Description

The script provided in the server files ServerStart.sh is not POSIX (sh) compliant, but has the shebang #!/bin/sh.
&> is a Bash-ism and does not do what you want it to do in sh. Instead use the explicit 2>&1 >/dev/null OR just make the script a Bash script.
Also, type is not POSIX either and more importantly -p is not always a valid flag for type. For this, I would suggest using the POSIX compliant command -v instead (or again, just making the shebang Bash).
Also, -s and -n are not POSIX required flags for read.

No idea where this script comes from, I couldn't find it searching GitHub, if you point me to it I'm happy to make the PR.


The script fails to start the server anyway with a very obvious error message, so this issue is extremely minor and nitpicky.

[Pre Start] Java install found.
-p: not found
java: not found
Java Installed: 
./ServerStart.sh: 37: [: Illegal number: 
./ServerStart.sh: 43: [: Illegal number: 
[Post Start] Starting SkyFactory One Server...
./ServerStart.sh: 50: java: not found

Additional Information

Tested using Bash in POSIX mode (automatically entered when running a script with a sh shebang).

@rrama rrama added the bug Something isn't working label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant