JDP 發表於 2018-3-23 10:00:58

檢查 volume 是否已經被 mount 了

if grep -qs '/mnt/foo' /proc/mounts; then
    echo "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]
查看完整版本: 檢查 volume 是否已經被 mount 了