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