added mod exclude
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Djeeberjr 2022-09-15 13:28:44 +02:00
parent 725af3fcbd
commit 03a471cd0f
2 changed files with 14 additions and 8 deletions

View File

@ -8,6 +8,7 @@ services:
STEAM_USER: testo STEAM_USER: testo
STEAM_PASSWORD: testo STEAM_PASSWORD: testo
WORKSHOP_COLLECTION: 1400118996 WORKSHOP_COLLECTION: 1400118996
MOD_EXCLUDE: 667953829,1210050323,925018569,837729515,2041057379
volumes: volumes:
- arma3_dev_game:/home/steam/server - arma3_dev_game:/home/steam/server
- arma3_dev_mods:/home/steam/volumes/mods - arma3_dev_mods:/home/steam/volumes/mods

View File

@ -51,18 +51,23 @@ mkdir -p "$MOD_LINK_DIR"
rm -f "$MOD_LINK_DIR"/* rm -f "$MOD_LINK_DIR"/*
MODS_TO_LOAD="" MODS_TO_LOAD=""
MOD_EXCLUDE=${MOD_EXCLUDE:=""}
for mod_id in $(curl -s "https://steamcommunity.com/sharedfiles/filedetails/?id=$WORKSHOP_COLLECTION" | grep -E 'id="sharedfile_[0-9]+"' | sed 's/.*id="sharedfile_\([0-9]\+\)".*/\1/') for mod_id in $(curl -s "https://steamcommunity.com/sharedfiles/filedetails/?id=$WORKSHOP_COLLECTION" | grep -E 'id="sharedfile_[0-9]+"' | sed 's/.*id="sharedfile_\([0-9]\+\)".*/\1/')
do do
# Check if directory exists
if [ ! -d "$VOLUME_HOME/mods/$mod_id" ]; then
echo "Could not find mod directory for $mod_id"
echo "Try to download it first"
exit 1
fi
ln -s "$VOLUME_HOME/mods/$mod_id" "$MOD_LINK_DIR/$mod_id" # Check if mod is excluded
MODS_TO_LOAD="${MODS_TO_LOAD}mods/${mod_id};" if [[ "$MOD_EXCLUDE" == *"$mod_id"* ]]; then
# Check if directory exists
if [ ! -d "$VOLUME_HOME/mods/$mod_id" ]; then
echo "Could not find mod directory for $mod_id"
echo "Try to download it first"
exit 1
fi
ln -s "$VOLUME_HOME/mods/$mod_id" "$MOD_LINK_DIR/$mod_id"
MODS_TO_LOAD="${MODS_TO_LOAD}mods/${mod_id};"
fi
done done
if [ -n "$MODS_TO_LOAD" ]; then if [ -n "$MODS_TO_LOAD" ]; then