Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Dec 22, 2023
1 parent 4e00c87 commit c6a296e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/mk-data-partition
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ if [ -f $filename ]; then
size=${size:-300M}
echo "Extend $filename by $size"
truncate -s +$size $filename
if [ $? -ne 0 ]; then
echo "Cannot extend $filename. Aborting"
exit 9
fi
loop=$(losetup -P -f --show $filename)
if [ "$?" -ne 0 ]; then
echo "Cannot create loop device"
Expand Down

0 comments on commit c6a296e

Please sign in to comment.