wrong variable type

This commit is contained in:
mfgbhatti 2022-02-20 17:26:34 +00:00
parent 8ea373bc60
commit 2ba0a3eeb9
1 changed files with 3 additions and 3 deletions

View File

@ -93,8 +93,8 @@ do_format() {
do_lvm() { do_lvm() {
i=0 i=0
while [[ "$i" -le "${#LVM_PART_NUM[@]}" ]]; do while [[ "$i" -le "$LVM_PART_NUM" ]]; do
if [[ "${#LVM_PART_NUM[@]}" -eq "1" ]]; then if [[ "$LVM_PART_NUM" -eq "1" ]]; then
lvcreate --extents 100%FREE "$LVM_VG" --name "${LVM_NAMES[$i]}" lvcreate --extents 100%FREE "$LVM_VG" --name "${LVM_NAMES[$i]}"
else else
lvcreate --size "${LVM_SIZES[$i]}" "$LVM_VG" --name "${LVM_NAMES[$i]}" lvcreate --size "${LVM_SIZES[$i]}" "$LVM_VG" --name "${LVM_NAMES[$i]}"
@ -106,7 +106,7 @@ do_lvm() {
mount_lvm() { mount_lvm() {
vgchange -ay &>/dev/null vgchange -ay &>/dev/null
i=0 i=0
while [[ "$i" -le "${#LVM_PART_NUM[@]}" ]]; do while [[ "$i" -le "$LVM_PART_NUM" ]]; do
lvchange -ay /dev/"$LVM_VG"/"${LVM_NAMES[$i]}" &>/dev/null lvchange -ay /dev/"$LVM_VG"/"${LVM_NAMES[$i]}" &>/dev/null
do_format /dev/"$LVM_VG"/"${LVM_NAMES[$i]}" do_format /dev/"$LVM_VG"/"${LVM_NAMES[$i]}"