From 577d18ce2635a81f85d3acd315203ccad70194ef Mon Sep 17 00:00:00 2001 From: Red-Thirten Date: Tue, 13 Jul 2021 23:24:28 -0700 Subject: [PATCH] Arma 3 - Small Bug Fix - Fixed RemoveDuplicates function adding an extra trailing semicolon if the input string is empty. - Added Aussie Server Hosts as a credited contributor for help and ideas on the project. --- games/arma3/entrypoint.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/games/arma3/entrypoint.sh b/games/arma3/entrypoint.sh index 6fa43d1..be87780 100644 --- a/games/arma3/entrypoint.sh +++ b/games/arma3/entrypoint.sh @@ -2,7 +2,8 @@ ## File: Pterodactyl Arma 3 Image - entrypoint.sh ## Author: David Wolfe (Red-Thirten) -## Date: 2021/07/11 +## Contributors: Aussie Server Hosts (https://aussieserverhosts.com/) +## Date: 2021/07/13 ## License: MIT License ## === CONSTANTS === @@ -143,7 +144,9 @@ function ModsLowercase { # Removes duplicate items from a semicolon delimited string function RemoveDuplicates { #[Input: str - Output: printf of new str] - echo $1 | sed -e 's/;/\n/g' | sort -u | xargs printf '%s;' + if [[ -n $1 ]]; then # If nothing to compare, skip to prevent extra semicolon being returned + echo $1 | sed -e 's/;/\n/g' | sort -u | xargs printf '%s;' + fi } # === ENTRYPOINT START ===