Skip to content

Commit

Permalink
process_config: avoid overwrite of PART parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Valente <[email protected]>
  • Loading branch information
Algodev-github committed Mar 30, 2020
1 parent f587a79 commit 899d2a0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions process_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ function find_dev_for_dir
exit
fi

PART=$(basename $PART)
BASEPART=$(basename $PART)
REALPART=$(basename $REALPATH)

BACKING_DEVS=
if [[ "$(echo $PART | egrep loop)" != "" ]]; then
# loopback device: $PART is already equal to the device name
BACKING_DEVS=$PART
if [[ "$(echo $BASEPART | egrep loop)" != "" ]]; then
# loopback device: $BASEPART is already equal to the device name
BACKING_DEVS=$BASEPART
else
# get devices from partition
for dev in $(ls /sys/block/); do
match=$(lsblk /dev/$dev | egrep "$PART|$REALPART")
match=$(lsblk /dev/$dev | egrep "$BASEPART|$REALPART")
if [[ "$match" == "" ]]; then
continue
fi
Expand Down Expand Up @@ -134,7 +134,7 @@ function find_dev_for_dir
fi

if [[ "$BACKING_DEVS" == "" ]]; then
echo Block devices for partition $PART or $REALPART unrecognized.
echo Block devices for partition $BASEPART or $REALPART unrecognized.
print_dev_help
exit
fi
Expand Down

0 comments on commit 899d2a0

Please sign in to comment.