From 4b79fc99ab7dfba844f0bf48e0a5ab253221ad00 Mon Sep 17 00:00:00 2001 From: aclist Date: Sun, 14 Aug 2022 09:38:08 +0900 Subject: [PATCH] Clean up legacy symlinks --- changelog.md | 6 +++++- dzgui.sh | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 3593b90..9caba80 100644 --- a/changelog.md +++ b/changelog.md @@ -4,7 +4,11 @@ - Clean up logging - Custom query API -## [2.4.2-rc.3] 2022-08-10 +## [2.4.2-rc.4] 2022-08-13 +### Changd +- Clean up legacy symlinks + +## [2.4.2-rc.3] 2022-08-13 ### Fixed - Prevent collisions in symlink IDs diff --git a/dzgui.sh b/dzgui.sh index 351148f..8e0d241 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o pipefail -version=2.4.2-rc.2 +version=2.4.2-rc.4 aid=221100 game="dayz" workshop="steam://url/CommunityFilePage/" @@ -348,6 +348,14 @@ legacy_symlinks(){ unlink "$d" fi done + for d in "$workshop_dir"/*; do + local id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}') + local encoded_id=$(echo "$id" | awk '{printf("%c",$1)}' | base64 | sed 's/\//_/g; s/=//g; s/+/]/g') + if [[ -h "$game_dir/@$encoded_id" ]]; then + unlink "$game_dir/@$encoded_id" + fi + done + exit } symlinks(){ for d in "$workshop_dir"/*; do