檢查 volume 是否已經被 mount 了
if grep -qs '/mnt/foo' /proc/mounts; thenecho "It's mounted."
else
echo "It's not mounted."
fi
Reference:
https://serverfault.com/questions/50585/whats-the-best-way-to-check-if-a-volume-is-mounted-in-a-bash-script?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
頁:
[1]