Skip to content

Commit 47b693c

Browse files
committed
rootless-install.sh: fix some shellcheck warnings
Fixes some shellcheck linting warnings: - [SC2034][SC2034]: "SCRIPT_COMMIT_SHA appears unused. Verify use (or export if used externally)." - [SC2046][SC2046]: "Quote this to prevent word splitting" - [SC2002][SC2002]: "Useless cat. Consider cmd < file | .. or cmd file | .. instead" - [SC2064][SC2064]: "Use single quotes, otherwise this expands now rather than when signalled." [SC2034]: https://github.com/koalaman/shellcheck/wiki/SC2034 [SC2002]: https://github.com/koalaman/shellcheck/wiki/SC2002 [SC2046]: https://github.com/koalaman/shellcheck/wiki/SC2046 [SC2064]: https://github.com/koalaman/shellcheck/wiki/SC2064 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent e5f4d99 commit 47b693c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

rootless-install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ dnf install -y iptables"
156156
fi
157157

158158
# ip_tables module dependency check
159-
if [ -z "$SKIP_IPTABLES" ] && ! lsmod | grep ip_tables >/dev/null 2>&1 && ! cat /lib/modules/$(uname -r)/modules.builtin | grep ip_tables >/dev/null 2>&1; then
159+
if [ -z "$SKIP_IPTABLES" ] && ! lsmod | grep ip_tables >/dev/null 2>&1 && ! grep -q ip_tables "/lib/modules/$(uname -r)/modules.builtin"; then
160160
INSTRUCTIONS="${INSTRUCTIONS}
161161
modprobe ip_tables"
162162
fi
@@ -225,11 +225,13 @@ exec_setuptool() {
225225
}
226226

227227
do_install() {
228+
echo "# Executing docker rootless install script, commit: $SCRIPT_COMMIT_SHA"
229+
228230
init_vars
229231
checks
230232

231233
tmp=$(mktemp -d)
232-
trap "rm -rf $tmp" EXIT INT TERM
234+
trap 'rm -rf "$tmp"' EXIT INT TERM
233235
# Download tarballs docker-* and docker-rootless-extras=*
234236
(
235237
cd "$tmp"

0 commit comments

Comments
 (0)