diff --git a/Dockerfile b/Dockerfile index e9c7f51..5a461bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ RUN dpkg --add-architecture i386 && \ apt-get update -y && \ apt-get install -y mailutils postfix curl wget file bzip2 gzip unzip bsdmainutils python util-linux ca-certificates \ binutils bc jq tmux lib32gcc1 libstdc++6 libstdc++6:i386 lib32tinfo5 \ - locales sudo && \ + locales sudo cron && \ \ groupadd -g $GROUP_ID $DOCKER_USER && \ useradd -d "$STEAM_PATH" -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \ diff --git a/experimental.sh b/experimental.sh index eee43c8..96ad791 100644 --- a/experimental.sh +++ b/experimental.sh @@ -41,6 +41,16 @@ if [ -n "${SERVER_VOICE_ENABLE}" ]; then configReplace "sv_voiceenable" "$SERVER_VOICE_ENABLE" fi +#set up cronjob +crontab -r | true +rm -f "$STEAM_PATH/lgsm-cronjobs" | true +touch "$STEAM_PATH/lgsm-cronjobs" +echo "*/5 * * * * su - '$DOCKER_USER' -c '$STEAM_PATH/gmodserver monitor' > /dev/null 2>&1" >> "$STEAM_PATH/lgsm-cronjobs" +echo "*/30 * * * * su - '$DOCKER_USER' -c '$STEAM_PATH/gmodserver update' > /dev/null 2>&1" >> "$STEAM_PATH/lgsm-cronjobs" +echo "0 10 * * 0 su - '$DOCKER_USER' -c '$STEAM_PATH/gmodserver force-update' > /dev/null 2>&1" >> "$STEAM_PATH/lgsm-cronjobs" +echo "" >> "$STEAM_PATH/lgsm-cronjobs" +crontab "$STEAM_PATH/lgsm-cronjobs" + #this is a simple option for myself, but you can use it too if [ "$USE_MY_REPLACER_CONFIG" = "true" ] && [ ! -e "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace" ]; then mkdir -p "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace"