28ab1c
From 1fd29d8550d7d1573b2d2a60b41d6a5f3ca5003f Mon Sep 17 00:00:00 2001
28ab1c
From: Harald Hoyer <harald@redhat.com>
28ab1c
Date: Fri, 12 Feb 2021 13:26:14 +0100
28ab1c
Subject: [PATCH] fix: shellcheck for modules.d/99squash/clear-squash.sh
28ab1c
28ab1c
(cherry picked from commit 73f5cc7c3754f9561abe948b4b080a84b34c7d1a)
28ab1c
28ab1c
Resolves: #1959336
28ab1c
---
28ab1c
 modules.d/99squash/clear-squash.sh | 9 +++------
28ab1c
 1 file changed, 3 insertions(+), 6 deletions(-)
28ab1c
28ab1c
diff --git a/modules.d/99squash/clear-squash.sh b/modules.d/99squash/clear-squash.sh
28ab1c
index 34cb4cf5..1d626f98 100755
28ab1c
--- a/modules.d/99squash/clear-squash.sh
28ab1c
+++ b/modules.d/99squash/clear-squash.sh
28ab1c
@@ -1,9 +1,6 @@
28ab1c
-#!/bin/sh
28ab1c
+#!/bin/bash
28ab1c
 SQUASH_MNT_REC=/squash/mounts
28ab1c
-SQUASH_MNTS=( )
28ab1c
 
28ab1c
-while read mnt; do
28ab1c
-    SQUASH_MNTS+=( "$mnt" )
28ab1c
-done <<< "$(cat $SQUASH_MNT_REC)"
28ab1c
+mapfile -t SQUASH_MNTS < $SQUASH_MNT_REC
28ab1c
 
28ab1c
-umount --lazy -- ${SQUASH_MNTS[@]}
28ab1c
+umount --lazy -- "${SQUASH_MNTS[@]}"
28ab1c