Skip to content

Commit

Permalink
feat: change from using watch to cron
Browse files Browse the repository at this point in the history
Watch command is sometimes causing updates to lock up. Migrating to cronjob instead
  • Loading branch information
dgibbs64 committed Oct 26, 2023
1 parent a2e59a1 commit bc829b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.ubuntu-1804
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV LGSM_SERVERFILES=/data/serverfiles
ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV GAMESERVER=jc2server
ENV UPDATE_CHECK=1800
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1000
ENV GID=1000
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ubuntu-2004
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV LGSM_SERVERFILES=/data/serverfiles
ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV GAMESERVER=jc2server
ENV UPDATE_CHECK=1800
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1000
ENV GID=1000
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ubuntu-2204
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV LGSM_SERVERFILES=/data/serverfiles
ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV GAMESERVER=jc2server
ENV UPDATE_CHECK=1800
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1000
ENV GID=1000
Expand Down
6 changes: 3 additions & 3 deletions entrypoint-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ else
# Sponsor to display LinuxGSM logo
./"${GAMESERVER}" sponsor
fi

echo -e ""
echo -e "Starting Update Checks"
echo -e "================================="
nohup watch -n "${UPDATE_CHECK}" ./"${GAMESERVER}" update > /dev/null 2>&1 &
minutes=$((UPDATE_CHECK / 60))
echo -e "update will check every ${minutes} minutes"
echo -e "* */${UPDATE_CHECK} * * * /app/${GAMESERVER} update > /dev/null 2>&1" | crontab -
echo -e "update will check every ${UPDATE_CHECK} minutes"

# Update game server
if [ -z "${install}" ]; then
Expand Down

0 comments on commit bc829b3

Please sign in to comment.