mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 15:12:48 +01:00
Hotfix for long concatenations of mods
This commit is contained in:
1 parent
94cbfd3f62
commit
a143cc4496
1 file changed
+8
-4
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
version=0.3.3
|
version=0.3.4
|
||||||
release_url="https://raw.githubusercontent.com/aclist/dztui/main/dztui.sh"
|
release_url="https://raw.githubusercontent.com/aclist/dztui/main/dztui.sh"
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
@@ -93,11 +93,15 @@ parse_json(){
|
|||||||
check_ping
|
check_ping
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
encode(){
|
||||||
|
echo "$1" | awk '{printf("%c",$1)}' | base64 | sed 's/\//_/g; s/=//g'
|
||||||
|
}
|
||||||
symlinks(){
|
symlinks(){
|
||||||
for d in "$workshop_dir"/*; do
|
for d in "$workshop_dir"/*; do
|
||||||
id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}')
|
id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}')
|
||||||
|
encoded_id=$(encode "$id")
|
||||||
mod=$(awk -F\" '/name/ {print $2}' "$d"/meta.cpp | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')
|
mod=$(awk -F\" '/name/ {print $2}' "$d"/meta.cpp | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')
|
||||||
link="@$id-$mod"
|
link="@$encoded_id"
|
||||||
[[ -h "$game_dir/$link" ]] && : ||
|
[[ -h "$game_dir/$link" ]] && : ||
|
||||||
printf "[INFO] Creating symlink for $mod\n"
|
printf "[INFO] Creating symlink for $mod\n"
|
||||||
ln -fs "$d" "$game_dir/$link"
|
ln -fs "$d" "$game_dir/$link"
|
||||||
@@ -139,8 +143,8 @@ concat_mods(){
|
|||||||
readarray -t serv <<< "$(server_modlist)"
|
readarray -t serv <<< "$(server_modlist)"
|
||||||
for i in "${serv[@]}"; do
|
for i in "${serv[@]}"; do
|
||||||
id=$(awk -F"= " '/publishedid/ {print $2}' "$workshop_dir"/$i/meta.cpp | awk -F\; '{print $1}')
|
id=$(awk -F"= " '/publishedid/ {print $2}' "$workshop_dir"/$i/meta.cpp | awk -F\; '{print $1}')
|
||||||
mod=$(awk -F\" '/name/ {print $2}' "$workshop_dir"/$i/meta.cpp | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')
|
encoded_id=$(encode $id)
|
||||||
link="@$id-$mod;"
|
link="@$encoded_id;"
|
||||||
echo -e "$link"
|
echo -e "$link"
|
||||||
done | tr -d '\n' | perl -ple 'chop'
|
done | tr -d '\n' | perl -ple 'chop'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user