I am making a scriptthat will detect if the samba share in inaccessible for any reason (for me, this happens a lot; hence the need for this script ) and then it will (if it is inaccessible) ask you to enter your password to restart it.

The script goes something like this:
Code:
#!/bin/bash
while [ 1 == 1 ]; do
if [ -d "smb://ubuntu/win" ]; then
sleep 500
else
zenity --notification  --text "Please enter the root password to restart the malfunctioning Samba networking system"
gksudo /etc/init.d/samba restart
zenity --notification  --window-icon="/usr/share/icons/Human/24x24/actions/dialog-apply.png"  --text "Samba network restarted successfully!" &
fi
done
It occurred to me that it may not be able to check, or even read directories on a network for security reasons, so can anyone recommend another way for checking it?