As @dilberts_left_nut mentioned mountpoint is the way. Here's an example from one of my backup scripts - this bails out of the script and sets an errorlevel if there isn't a filesystem mounted to the mountpoint.
Code:
if mountpoint -q /media/external; then /usr/bin/systemctl stop qbittorrent.service radarr.service sonarr.service prowlarr.service /usr/bin/rsync -qam --delete /media/internal/music/ /media/external/music & /usr/bin/rsync -qam --delete /media/internal/videos/ /media/external/videos &else exit 1
Statistics: Posted by wizard10000 — 2024-07-30 10:09