update add new start file
vintage-story-build-latest / Docker prune (vm-docker-build2) (push) Successful in 3s
vintage-story-build-latest / poll-debian-base-and-detect-changes (push) Successful in 6s
vintage-story-build-latest / Build and Push latest (push) Successful in 24s
vintage-story-build-latest / generate-changelogs (push) Successful in 7s
vintage-story-build-latest / generate-build-info (push) Successful in 8s
vintage-story-build-latest / Docker prune (vm-docker-build2) (push) Successful in 3s
vintage-story-build-latest / poll-debian-base-and-detect-changes (push) Successful in 6s
vintage-story-build-latest / Build and Push latest (push) Successful in 24s
vintage-story-build-latest / generate-changelogs (push) Successful in 7s
vintage-story-build-latest / generate-build-info (push) Successful in 8s
This commit is contained in:
+26
-12
@@ -7,6 +7,7 @@ VS_SERVER_DIR=/vs_server/server
|
||||
VS_DATA_DIR=/vs_server/server/data
|
||||
START_FILE=$VS_SERVER_DIR/server-$VS_VERSION.sh
|
||||
LOG_FILE=$VS_DATA_DIR/Logs/server-main.log
|
||||
START_FILE=https://gitea.fithwum.tech/fithwum/vintage-story/raw/branch/main/latest/start.sh
|
||||
VS_SERVER_FILE=https://cdn.vintagestory.at/gamefiles/$VS_CHANNEL/vs_server_linux-x64_$VS_VERSION.tar.gz
|
||||
MS_REPO_URL=https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb
|
||||
USERNAME=adduser vintagestory
|
||||
@@ -94,23 +95,36 @@ chmod 776 -R $VS_SERVER_DIR
|
||||
# Setup the server
|
||||
if [ ! -f $MARKER_FILE ]; then
|
||||
echo "First time run: Setting up server environment..."
|
||||
yes y | $VS_SERVER_DIR/server-1.21.5.sh setup $USERNAME $VS_DATA_DIR && touch $MARKER_FILE
|
||||
yes y | $VS_SERVER_DIR/server-1.21.5.sh setup $USERNAME $VS_DATA_DIR
|
||||
touch $MARKER_FILE
|
||||
echo "Setup successfully completed."
|
||||
fi
|
||||
|
||||
# Download the start file for the screen session
|
||||
if [ -f $VS_SERVER_DIR/start.sh ]; then
|
||||
echo "INFO ! start.sh found ... moving on."
|
||||
else
|
||||
echo "WARNING ! start.sh missing ... downloading default file."
|
||||
wget --no-cache --show-progress --progress=bar:force:noscroll $START_FILE -O $VS_SERVER_DIR/start.sh
|
||||
chmod +x $VS_SERVER_DIR/start.sh
|
||||
fi
|
||||
|
||||
# Run vintage-story server.
|
||||
echo " "
|
||||
echo "INFO ! Starting vintage-story Server $VS_VERSION"
|
||||
.$VS_SERVER_DIR/server-$VS_VERSION.sh start
|
||||
cd $VS_SERVER_DIR
|
||||
exec ./start.sh
|
||||
|
||||
echo "Waiting for the server log file to be created..."
|
||||
# Loop indefinitely until the log file actually exists on disk
|
||||
until [ -f "$LOG_FILE" ]; do
|
||||
sleep 1
|
||||
done
|
||||
# echo " "
|
||||
# echo "INFO ! Starting vintage-story Server $VS_VERSION"
|
||||
# .$VS_SERVER_DIR/server-$VS_VERSION.sh start
|
||||
|
||||
echo "Log file found! Streaming server console now..."
|
||||
# Hand off PID 1 to tail, keeping the container active permanently
|
||||
exec tail -f "$LOG_FILE"
|
||||
# echo "Waiting for the server log file to be created..."
|
||||
# # Loop indefinitely until the log file actually exists on disk
|
||||
# until [ -f "$LOG_FILE" ]; do
|
||||
# sleep 1
|
||||
# done
|
||||
|
||||
# echo "Log file found! Streaming server console now..."
|
||||
# # Hand off PID 1 to tail, keeping the container active permanently
|
||||
# exec tail -f "$LOG_FILE"
|
||||
|
||||
exit
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2026 fithwum
|
||||
# All rights reserved
|
||||
|
||||
LOG_FILE=/vs_server/server/data/Logs/server-main.log
|
||||
SESSION=server
|
||||
|
||||
cd /vs_server/server
|
||||
|
||||
echo "INFO ! A screen session for the Vintage-Story server is already running."
|
||||
cleanup() {
|
||||
echo "[INFO] Stopping Vintage-Story ..."
|
||||
screen -S "$SESSION" -X $SESSION "stop$(printf '\r')"
|
||||
# Wait up to 60 seconds
|
||||
for i in {1..60}; do
|
||||
if ! screen -list | grep -q "$SESSION"; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# Kill it if it's still alive
|
||||
screen -S "$SESSION" -X quit 2>/dev/null || true
|
||||
exit 0
|
||||
}
|
||||
trap cleanup SIGINT SIGTERM
|
||||
|
||||
# Start the Minecraft server in a detached screen session
|
||||
echo "INFO ! Starting Vintage-Story Server in a screen session."
|
||||
touch "$LOG_FILE"
|
||||
screen -L -Logfile "$LOG_FILE" -dmS "$SESSION" bash -c ./VintagestoryServer.dll
|
||||
exec tail -F "$LOG_FILE"
|
||||
Reference in New Issue
Block a user