From 7f3c2c19963c020e51a5c89f8e3996084eb923df Mon Sep 17 00:00:00 2001 From: d3adb5 Date: Sun, 8 May 2022 22:38:25 -0300 Subject: [PATCH] refactor: eliminate shellcheck warnings & errors Redirect multiple commands to the configuration file instead of making multiple redirects, potentially limiting the number of times the file needs to be opened for appending. (SC2129) Use "${arr[*]}" not to mix array and string. (SC2145) --- entrypoint.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 51f8040..806e20f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -85,10 +85,11 @@ else set_config "port" 64738 true set_config "users" 100 true - # Add ICE section - echo -e "\n[Ice]" >> "$CONFIG_FILE" - echo "Ice.Warn.UnknownProperties=1" >> "$CONFIG_FILE" - echo "Ice.MessageSizeMax=65536" >> "$CONFIG_FILE" + { # Add ICE section + echo -e "\n[Ice]" + echo "Ice.Warn.UnknownProperties=1" + echo "Ice.MessageSizeMax=65536" + } >> "$CONFIG_FILE" fi # Additional environment variables @@ -107,7 +108,7 @@ echo "Running Mumble server as uid=$(id -u) gid=$(id -g)" echo "\"${DATA_DIR}\" has the following permissions set:" echo " $( stat ${DATA_DIR} --printf='%A, owner: \"%U\" (UID: %u), group: \"%G\" (GID: %g)' )" -echo "Command run to start the service : ${server_invocation[@]}" +echo "Command run to start the service : ${server_invocation[*]}" echo "Starting..." exec "${server_invocation[@]}"