From 1015fe518441adfba21519e38fd6f594dcecda42 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 28 Feb 2018 10:28:35 -0600 Subject: [PATCH] Use ${var:?} to ensure this never expands to /* . https://github.com/koalaman/shellcheck/wiki/SC2115 --- update_ombi.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update_ombi.sh b/update_ombi.sh index d73f4df..3b83aee 100644 --- a/update_ombi.sh +++ b/update_ombi.sh @@ -99,7 +99,7 @@ unzip-strip() ( cp -r "$temp"/*/* "$dest" else cp -r "$temp"/* "$dest" - fi && rm -rf "$temp"/* "$temp" + fi && rm -rf "${temp:?}"/* "$temp" ) # Import any custom config to override the defaults, if necessary @@ -314,7 +314,7 @@ else fi .log 6 "Cleaning up..." -rm -rf "$tempdir"/* "$tempdir" +rm -rf "${tempdir:?}"/* "$tempdir" declare -i elapsedtime=$SECONDS declare -i minutes=0 declare -i seconds=0 @@ -334,4 +334,4 @@ elif [ $seconds -eq 1 ]; then fi durationmsg="Update complete...elapsed time $duration..." durationmsg="${durationmsg// / }" -.log 6 "$durationmsg" \ No newline at end of file +.log 6 "$durationmsg"