我想监视目录的传输是否与bash连接。
我目前有shell:
#!/bin/bash
mounts=('/mount1' '/mount2' '/mount3' '/mount4' '/HDD');
for mount in "${mounts[@]}"
do
if grep -qs ${mount} /proc/mounts
then
echo "${mount} is mounted."
else
#force remount
sudo umount -l ${mount}
sudo fusermount -uz ${mount}
sudo mount ${mount}
fi
done
但是grep -qs ${mount} /proc/mounts
实际上没有检查端点?我该怎么做呢?