How do I check if smbfs is accessible from Win Clients using a linux script
I am trying to write a PHP script (hosted on linux/apache/smb server) to automatically check if //NETBIOSNAME/SHARE (a samba smbfs share) is definitely accessible to windows clients before writing stuff to the unix mount point for the said share.
If I just check the linux mountpoint (e.g. /win_mounts/sharename) exists that doesn't tell me that //NETBIOSNAME/SHARE is still mounted to it.
Nor will PHP let me check using for example is_writable('//NETBIOSNAME/SHARE') from a linux hosted apache web server, it only lets me check the linux file system (i.e. the mount point, not if it's actually mounted).
smbclient I hear you cry, however smbclient always takes you to a smbclient /> command prompt and I have been unable to find any way to
bypass this 'smbclient />' command prompt, which requires human input to execute smbclient commands and cannot it seems be executed by passing a line of code and options to it.
Does anyone have any suggestions on either how to supress the command prompt interface of smbclient so it returns results from single line requests, or have some other ideas on how to test if a windows share is mounted on the unix/linux file system and will be visible to windows clients ?
I welcome your thoughts