Browse Source

feat: improve log tailing

pull/5/head
Daniel Gibbs 3 years ago
parent
commit
06f7efe19f
  1. 34
      entrypoint.sh

34
entrypoint.sh

@ -2,14 +2,14 @@
exit_handler() { exit_handler() {
# Execute the shutdown commands # Execute the shutdown commands
echo "stopping ${GAMESERVER}" echo -e "stopping ${GAMESERVER}"
./${GAMESERVER} stop ./${GAMESERVER} stop
exitcode=$? exitcode=$?
exit ${exitcode} exit ${exitcode}
} }
# Exit trap # Exit trap
echo "Loading exit handler" echo -e "Loading exit handler"
trap exit_handler SIGQUIT SIGINT SIGTERM trap exit_handler SIGQUIT SIGINT SIGTERM
echo -e "" echo -e ""
@ -39,14 +39,14 @@ cd /linuxgsm || exit
# Setup game server # Setup game server
if [ ! -f "${GAMESERVER}" ]; then if [ ! -f "${GAMESERVER}" ]; then
echo "" echo -e ""
echo "creating ./${GAMESERVER}" echo -e "creating ./${GAMESERVER}"
./linuxgsm.sh ${GAMESERVER} ./linuxgsm.sh ${GAMESERVER}
fi fi
if [ -d "/linuxgsm/lgsm/functions" ]; then if [ -d "/linuxgsm/lgsm/functions" ]; then
echo "" echo -e ""
echo "check all functions are executable" echo -e "check all functions are executable"
chmod +x /linuxgsm/lgsm/functions/* chmod +x /linuxgsm/lgsm/functions/*
fi fi
@ -57,29 +57,35 @@ fi
# Install game server # Install game server
if [ -z "$(ls -A -- "serverfiles")" ]; then if [ -z "$(ls -A -- "serverfiles")" ]; then
echo "" echo -e ""
echo "installing ${GAMESERVER}" echo -e "Installing ${GAMESERVER}"
echo -e "================================="
./${GAMESERVER} auto-install ./${GAMESERVER} auto-install
else else
# Donate to display logo # Donate to display logo
./${GAMESERVER} donate ./${GAMESERVER} donate
fi fi
echo "starting cron" echo -e "Starting cron"
echo -e "================================="
cron cron
# Update game server # Update game server
echo "" echo -e ""
echo "updating ${GAMESERVER}" echo -e "Updating ${GAMESERVER}"
echo -e "================================="
./${GAMESERVER} update ./${GAMESERVER} update
echo "" echo -e ""
echo "starting ${GAMESERVER}" echo -e "Starting ${GAMESERVER}"
echo -e "================================="
./${GAMESERVER} start ./${GAMESERVER} start
sleep 5 sleep 5
./${GAMESERVER} details ./${GAMESERVER} details
sleep 2 sleep 2
tail -F log/script/* echo -e "Tail log files"
echo -e "================================="
tail -F log/*/*.log
# with no command, just spawn a running container suitable for exec's # with no command, just spawn a running container suitable for exec's
if [ $# = 0 ]; then if [ $# = 0 ]; then

Loading…
Cancel
Save