Browse Source

feat: change from using watch to cron

Watch command is sometimes causing updates to lock up. Migrating to cronjob instead
pull/37/merge
Daniel Gibbs 1 year ago
parent
commit
bc829b39eb
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 2
      Dockerfile.ubuntu-1804
  2. 2
      Dockerfile.ubuntu-2004
  3. 2
      Dockerfile.ubuntu-2204
  4. 6
      entrypoint-user.sh

2
Dockerfile.ubuntu-1804

@ -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

2
Dockerfile.ubuntu-2004

@ -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

2
Dockerfile.ubuntu-2204

@ -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

6
entrypoint-user.sh

@ -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

Loading…
Cancel
Save