Hi, my hdd sometimes disconnects from the nas by itself, that doesnt bother me. What I want is to write a script to test it:
Code:
# ls /usb/sdb1/
ls: /usb/sdb1/: Transport endpoint is not connected
This shows up when the hdd disconnects, I wonder if how I can use an if statement to get it:
Code:
output=$(ls /usb/sdb1/)
echo "$output"
if [ "$output" == "ls: .: Transport endpoint is not connected" ] ; then
echo "yes"
fi
But there are no outputs.
Thanks,
Ted