diff --git a/egg-hytale.json b/egg-hytale.json index b4394e2..f751966 100644 --- a/egg-hytale.json +++ b/egg-hytale.json @@ -4,7 +4,7 @@ "version": "PLCN_v3", "update_url": "https://raw.githubusercontent.com/NATroutter/egg-hytale/refs/heads/main/egg-hytale.json" }, - "exported_at": "2026-01-11T21:39:39+00:00", + "exported_at": "2026-01-11T21:41:54+00:00", "name": "Hytale", "author": "contact@natroutter.fi", "uuid": "6594b287-2d7b-4249-bc93-4d40283c57e3", @@ -90,6 +90,19 @@ ], "sort": 4 }, + { + "name": "Automatic Update", + "description": "Update the hytale server automaticly", + "env_variable": "AUTOMATIC_UPDATE", + "default_value": "1", + "user_viewable": false, + "user_editable": true, + "rules": [ + "required", + "boolean" + ], + "sort": 10 + }, { "name": "Backup Directory", "description": "Directory where backups are saved", diff --git a/start.sh b/start.sh index 4b843f7..3a81f26 100644 --- a/start.sh +++ b/start.sh @@ -12,22 +12,25 @@ DOWNLOADER="./hytale-downloader-linux-amd64" -# Check if the downloader exists -if [ ! -f "$DOWNLOADER" ]; then - echo "Error: Hytale downloader not found!" - echo "Please run the installation script first." - exit 1 -fi +# Run automatic update if enabled +if [ "${AUTOMATIC_UPDATE}" = "1" ]; then + # Check if the downloader exists + if [ ! -f "$DOWNLOADER" ]; then + echo "Error: Hytale downloader not found!" + echo "Please run the installation script first." + exit 1 + fi -# Check if the downloader is executable -if [ ! -x "$DOWNLOADER" ]; then - echo "Setting executable permissions..." - chmod +x "$DOWNLOADER" -fi + # Check if the downloader is executable + if [ ! -x "$DOWNLOADER" ]; then + echo "Setting executable permissions..." + chmod +x "$DOWNLOADER" + fi -echo "Starting Hytale downloader..." -$DOWNLOADER -check-update -$DOWNLOADER + echo "Starting Hytale downloader..." + $DOWNLOADER -check-update + $DOWNLOADER +fi echo "Starting Hytale server..."