Update start.sh
Browse files
start.sh
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
# Debug: Show current directory and files
|
| 4 |
-
echo "Debug: Current dir: $(pwd)"
|
| 5 |
-
echo "Debug: Files in /opt/minecraft: $(ls -l /opt/minecraft)"
|
| 6 |
-
|
| 7 |
-
# Debug: Check Java version
|
| 8 |
-
echo "Debug: Java version:"
|
| 9 |
-
java -version
|
| 10 |
-
|
| 11 |
-
# Run dummy HTTP server in background (quiet output)
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
playit
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
java -Xmx12G -Xms1G -jar server.jar nogui || echo "Error: Minecraft failed with exit code $?"
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Debug: Show current directory and files
|
| 4 |
+
echo "Debug: Current dir: $(pwd)"
|
| 5 |
+
echo "Debug: Files in /opt/minecraft: $(ls -l /opt/minecraft)"
|
| 6 |
+
|
| 7 |
+
# Debug: Check Java version
|
| 8 |
+
echo "Debug: Java version:"
|
| 9 |
+
java -version
|
| 10 |
+
|
| 11 |
+
# Run dummy HTTP server in background (quiet output)
|
| 12 |
+
# This will serve the directory listing on port 7860
|
| 13 |
+
python3 -m http.server 7860 > /dev/null 2>&1 &
|
| 14 |
+
|
| 15 |
+
# Run playit.gg in background (output goes to logs)
|
| 16 |
+
playit --secret $PLAYIT_SECRET &
|
| 17 |
+
|
| 18 |
+
# Wait a bit for playit to start (optional, helps with timing)
|
| 19 |
+
sleep 5
|
| 20 |
+
|
| 21 |
+
# Run Minecraft in FOREGROUND (so its logs show in Hugging Face)
|
| 22 |
+
echo "Starting Minecraft server..."
|
| 23 |
java -Xmx12G -Xms1G -jar server.jar nogui || echo "Error: Minecraft failed with exit code $?"
|