summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2023-02-09 16:04:54 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2023-02-10 17:50:27 +0100
commit773bc013778df631f9ee14e7a79d5f02211b1e67 (patch)
tree7952720e7c5b17164fe7ad95937c498f00f74120 /scripts
parentcc2293f18ed14f4b306c7e5b92e508a6981b4826 (diff)
downloadlvm2-773bc013778df631f9ee14e7a79d5f02211b1e67.tar.gz
tests: cleanup some shellcheck warns
Reduce shellcheck warnings about missing {} for possible array dereference. Make sure we are not loosing error code when assigning local vars and explicitely ignore 'errors' from standalone lines when needed. Add some missing quotes. Use $() instead of ancient `` Avoid writing some temporary data into /tmp - test need to store files within its own 'testdir' - so it can be properly discarded.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/lvm_import_vdo.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index c4c1d152e..134c96513 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -255,11 +255,11 @@ convert2lvm_() {
# Find largest matching VG name to our 'default' vgname
LASTVGNAME=$(LC_ALL=C "$LVM" vgs -oname -O-name --noheadings -S name=~${VGNAME} | grep -E "${VGNAME}[0-9]? ?" | head -1 || true)
if test -n "$LASTVGNAME" ; then
- LASTVGNAME=${LASTVGNAME#*${VGNAME}}
+ LASTVGNAME=${LASTVGNAME#*"${VGNAME}"}
# If the number is becoming too high, try some random number
test "$LASTVGNAME" -gt 99999999 2>/dev/null && LASTVGNAME=$RANDOM
# Generate new unused VG name
- VGNAME="${VGNAME}$(( ${LASTVGNAME} + 1 ))"
+ VGNAME="${VGNAME}$(( LASTVGNAME + 1 ))"
verbose "Selected unused volume group name $VGNAME."
fi
fi