diff --git a/test_z.sh b/test_z.sh index 9c868c6..6e4f6d0 100644 --- a/test_z.sh +++ b/test_z.sh @@ -61,7 +61,7 @@ EOF cat > "$MOCK_BIN/mountpoint" <> "$LOG_FILE" -return 1 # Simulate not mounted +exit 0 # Simulate already mounted EOF # Mock arch-chroot diff --git a/z.sh b/z.sh index 02c54ed..273d812 100755 --- a/z.sh +++ b/z.sh @@ -113,10 +113,11 @@ else echo "Filesystems created successfully." fi -# check if any of the devices is mounted -if mountpoint -q "$seed_device" || mountpoint -q "$sprout_device" || mountpoint -q "$efi_device"; then - echo "One or more devices are already mounted. Unmounting..." - umount -R "$seed_device" "$sprout_device" "$efi_device" + + +if mountpoint -q /mnt; then + echo "/mnt is already mounted. Unmounting..." + umount -R /mnt fi mount -o subvol=/ "$seed_device" /mnt