echo "Specified device $mydev is mounted on $blkdev_mountpoint, __filesystem does NOTHING with mountd devices" >&2
exit 0
fi
if [ -n "$blkdev_fstype" ] && [ "$forcefs" != "true" ]; then
if [ "$blkdev_label" != "$label" ]; then
echo "Specified device $mydev has not the spezified label: $blkdev_label, but __filesystem does NOTHING in this case without the --force option" >&2
exit 0
fi
if [ "$blkdev_fstype" != "$fstype" ]; then
echo "Specified device $mydev has not the spezified filesystem: $blkdev_fstype, but __filesystem does NOTHING in this case without the --force option" >&2
exit 0
fi
fi
# ok, all conditions checked, we need to format the device, lets go
opts="$mkfsoptions"
if [ -n "$label" ]; then
opts="$opts -L '$label'"
fi
case "$fstype" in
ext2|ext3|ext4)
if [ "$forcefs" = "true" ]; then
opts="$opts -F"
fi
echo "mkfs.$fstype $opts /dev/$blkdev_devname"
;;
btrfs)
if [ "$forcefs" = "true" ]; then
opts="$opts --force"
fi
echo "mkfs.btrfs $opts /dev/$blkdev_devname"
;;
xfs)
if [ "$forcefs" = "true" ]; then
opts="$opts -f"
fi
echo "mkfs.xfs $opts /dev/$blkdev_devname"
;;
*)
echo "__filesystem type lacks implementation for filesystem: $fstype" >&2
exit 1
;;
esac
echo "filesystem $fstype on $mydev : /dev/$blkdev_devname created" >> "$__messages_out"