Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Use the executable created by linuxgsm #74

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ fi
# Setup game server
if [ ! -f "${GAMESERVER}" ]; then
echo "creating ./${GAMESERVER}"
./linuxgsm.sh ${GAMESERVER}
exec_name=$(./linuxgsm.sh ${GAMESERVER} | grep -o ${GAMESERVER}-. | head -1)
if [ ! -z "$exec_name" ]; then
export GAMESERVER=$exec_name
fi
Comment on lines +39 to +42

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a better way of doing this would be using a bash parameter expansion substring

A REPL for this is available here

Suggested change
exec_name=$(./linuxgsm.sh ${GAMESERVER} | grep -o ${GAMESERVER}-. | head -1)
if [ ! -z "$exec_name" ]; then
export GAMESERVER=$exec_name
fi
./linuxgsm.sh ${GAMESERVER%-*}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may need to alter other parts of the script as well (such as exit_handler())

fi

# Install game server
Expand Down