#!/bin/bash
mkdir mounttest
sudo mount --bind .. mounttest  # other dir in same filesystem
mountpoint  mounttest
success="$?"
sudo umount mounttest
rmdir mounttest
if [[ 0 -eq $success ]]; then
echo success
else
echo failure
fi
exit $success
