The code `if [[ -f "$MPOINT/$CHECKFILE" ]]; then` should be written as `if [[ -f "$MPOINT/$CHECKFILEPATH" ]]; then`