BuildSystem: Don't fill mount dir if mounting fails

This commit is contained in:
Bananymous 2024-06-29 22:12:36 +03:00
parent 08cbd009ac
commit f792976d6d
1 changed files with 8 additions and 6 deletions

View File

@ -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