From f792976d6db01ca02165d7c7cfe3a07bebf0d91e Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 29 Jun 2024 22:12:36 +0300 Subject: [PATCH] BuildSystem: Don't fill mount dir if mounting fails --- script/image.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/script/image.sh b/script/image.sh index 679eca22f2..0abd95833d 100755 --- a/script/image.sh +++ b/script/image.sh @@ -32,12 +32,14 @@ if [ ! -b $ROOT_PARTITION ]; then exit 1 fi -sudo mount $ROOT_PARTITION $MOUNT_DIR +if sudo mount $ROOT_PARTITION $MOUNT_DIR; then + cd $MOUNT_DIR + sudo tar xf $BANAN_SYSROOT_TAR + sudo rm -rf $MOUNT_DIR/var/www + sudo cp -r $BANAN_SCRIPT_DIR/../www $MOUNT_DIR/var + cd -cd $MOUNT_DIR -sudo tar xf $BANAN_SYSROOT_TAR -cd - -sudo umount $MOUNT_DIR + sudo umount $MOUNT_DIR +fi sudo losetup -d $LOOP_DEV