From c4ed4bc021c82dd6dd9eb2dfd79e34491af97db3 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 3 Aug 2018 00:14:51 +0000 Subject: [PATCH] test-install: Fix shellcheck warnings. In tools/test-install/destroy-all line 31: | while read c ^-- SC2162: read without -r will mangle backslashes. In tools/test-install/install line 57: installer_dir="$(readlink -f $INSTALLER)" ^-- SC2086: Double quote to prevent globbing and word splitting. In tools/test-install/lxc-wait line 30: for i in {1..60}; do ^-- SC2034: i appears unused. Verify use (or export if used externally). Signed-off-by: Anders Kaseorg --- tools/test-install/destroy-all | 2 +- tools/test-install/install | 2 +- tools/test-install/lxc-wait | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test-install/destroy-all b/tools/test-install/destroy-all index 5deed5a8a8..cfb6cf950d 100755 --- a/tools/test-install/destroy-all +++ b/tools/test-install/destroy-all @@ -28,7 +28,7 @@ fi lxc-ls -f \ | perl -lane '$_ = $F[0]; print if (/^zulip-install-/ && !/-base$/)' \ - | while read c + | while read -r c do echo "$c" lxc-stop -n "$c" diff --git a/tools/test-install/install b/tools/test-install/install index cc62dc7d41..187633eea2 100755 --- a/tools/test-install/install +++ b/tools/test-install/install @@ -54,7 +54,7 @@ EOF trap 'set +x; echo "$message"' EXIT if [ -d "$INSTALLER" ]; then - installer_dir="$(readlink -f $INSTALLER)" + installer_dir="$(readlink -f "$INSTALLER")" else installer_dir="$(mktemp -d --tmpdir zulip-server-XXXXX)" tar -xf "$INSTALLER" -C "$installer_dir" --transform='s,^[^/]*,zulip-server,' diff --git a/tools/test-install/lxc-wait b/tools/test-install/lxc-wait index ccebe8b3cd..b03e300c9d 100755 --- a/tools/test-install/lxc-wait +++ b/tools/test-install/lxc-wait @@ -27,7 +27,7 @@ if [ "$EUID" -ne 0 ]; then fi # We poll. -for i in {1..60}; do +for _ in {1..60}; do echo "lxc-wait: $CONTAINER_NAME: polling for boot..." >&2 runlevel="$(lxc-attach -n "$CONTAINER_NAME" -- runlevel 2>/dev/null)" \ || { sleep 1; continue; }