I have remotely mounted a filesystem using SSHFS to directory /mnt/sshfs
.
I need to find out using a shell script if this SSHFS mount is working correctly or if there is a connection reset by peer
problem.
If I try to access such an SSHFS filesystem if it is in "disconnected state", the system freezes and waits until it eventually times out.
I want to avoid that. I need to know if SSHFS is working as expected or if there is some connection problem without freezing the system.
I guess just grep the mount command?
if (( $(mount | grep -e 'whatever you like'| wc -l) > 0 ));
then
echo "mounted";
fi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With