A shell script to mount a disk image file
The first conditional group can be reorganized to make it flatter and simpler:

if [ ! -e "${MOUNTPOINT}" ]; then
    sudo mkdir -p "${MOUNTPOINT}"
elif [ -d "${MOUNTPOINT}" ]; then
    echo "Mountpoint exists, but isn't a directory..."
    exit 1
fi


The exit 0 is pointless in the last condition,
and as such, you could replace it with a one-liner using &amp;&amp;:

mountpoint -q "${MOUNTPOINT}" &amp;&amp; echo "Already mounted..."