#!/bin/bash # Define an array of mount points to monitor mount_points=( "/backup" ) # Function to check if a mount point is mounted is_mounted() { mountpoint -q "$1" return $? } # Loop through the mount points and check if they are mounted for mount_point in "${mount_points[@]}"; do if is_mounted "$mount_point"; then echo "$mount_point is mounted." else echo "$mount_point is not mounted." fi done