17.shell检测NFS挂载
read -t1 < <(stat -t "/my/mountpoint") if [ $? -eq 1 ]; then echo NFS mount stale. Removing... umount -f -l /my/mountpoint fi 或 mountpoint="/my/mountpoint" read -t1 < <(stat -t "$mountpoint" 2>&-) if [[ -n "$REPLY" ]]; then echo "NFS mount stale. Removing..." umount -f -l "$mountpoint" fi
#### 2>&- 子shell的输出用2>& – 静音

浙公网安备 33010602011771号