Bug fixed - variable naming was wrong

This commit is contained in:
Igor Pečovnik 2015-12-17 09:17:25 +01:00
parent c87f3b69b5
commit 253a0cb63f

View File

@ -26,8 +26,8 @@ set -e
do_expand_rootfs(){
device="/dev/"$(lsblk -idn -o NAME | grep mmcblk0)
PARTITIONS=$(($(fdisk -l $device | grep $device | wc -l)-1))
PARTSTART=$(parted $LOOP unit s print -sm | tail -1 | cut -d: -f2 | sed 's/s//') # start of first partition
PARTEND=$(parted $LOOP unit s print -sm | head -3 | tail -1 | cut -d: -f3 | sed 's/s//') # end of first partition
PARTSTART=$(parted $device unit s print -sm | tail -1 | cut -d: -f2 | sed 's/s//') # start of first partition
PARTEND=$(parted $device unit s print -sm | head -3 | tail -1 | cut -d: -f3 | sed 's/s//') # end of first partition
STARTFROM=$(($PARTEND+1))
[[ $PARTITIONS == 1 ]] && STARTFROM=$PARTSTART
((echo d; echo $PARTITIONS; echo n; echo p; echo ; echo $STARTFROM; echo ; echo w;) | fdisk $device)>/dev/null