mirror of
https://github.com/mbround18/valheim-docker.git
synced 2021-10-22 21:53:54 +03:00
Add in flag for updating on startup (#202)
Co-authored-by: Michael <12646562+mbround18@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
83b761935d
commit
6cd9a0c208
@@ -44,7 +44,8 @@ ENV PUID=1000 \
|
||||
AUTO_BACKUP_REMOVE_OLD="1" \
|
||||
AUTO_BACKUP_DAYS_TO_LIVE="3" \
|
||||
AUTO_BACKUP_ON_UPDATE="0" \
|
||||
AUTO_BACKUP_ON_SHUTDOWN="0"
|
||||
AUTO_BACKUP_ON_SHUTDOWN="0" \
|
||||
UPDATE_ON_STARTUP="1"
|
||||
|
||||
COPY ./src/scripts/*.sh /home/steam/scripts/
|
||||
COPY ./src/scripts/entrypoint.sh /entrypoint.sh
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
| AUTO_BACKUP_ON_UPDATE | `0` | FALSE | Create a backup on right before updating and starting your server. |
|
||||
| AUTO_BACKUP_ON_SHUTDOWN | `0` | FALSE | Create a backup on shutdown. |
|
||||
| WEBHOOK_URL | `` | FALSE | Supply this to get information regarding your server's status in a webhook or Discord notification! [Click here to learn how to get a webhook url for Discord](https://help.dashe.io/en/articles/2521940-how-to-create-a-discord-webhook-url) |
|
||||
| UPDATE_ON_STARTUP | `1` | FALSE | Tries to update the server the container is started. |
|
||||
|
||||
### Docker Compose
|
||||
|
||||
@@ -99,6 +100,7 @@ services:
|
||||
- AUTO_BACKUP_ON_UPDATE=1
|
||||
- AUTO_BACKUP_ON_SHUTDOWN=1
|
||||
- WEBHOOK_URL="https://discord.com/api/webhooks/IM_A_SNOWFLAKE/AND_I_AM_A_SECRET"
|
||||
- UPDATE_ON_STARTUP=0
|
||||
volumes:
|
||||
- ./valheim/saves:/home/steam/.config/unity3d/IronGate/Valheim
|
||||
- ./valheim/server:/home/steam/valheim
|
||||
|
||||
@@ -42,8 +42,12 @@ export SteamAppId=${APPID:-892970}
|
||||
|
||||
# Setting up server
|
||||
log "Running Install..."
|
||||
if [ ! -f "./valheim_server.x86_64" ] || [ "${FORCE_INSTALL:-0}" -eq 1 ]; then
|
||||
if [ ! -f "./valheim_server.x86_64" ] || \
|
||||
[ "${FORCE_INSTALL:-0}" -eq 1 ]; then
|
||||
odin install || exit 1
|
||||
elif [ "${UPDATE_ON_STARTUP:-1}" -eq 1]; then
|
||||
log "Attempting to update before launching the server!"
|
||||
/bin/bash /home/steam/scripts/auto_update.sh
|
||||
else
|
||||
log "Skipping install process, looks like valheim_server is already installed :)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user