Zend certified PHP/Magento developer

Drive is disconnected but still appears as a shared drive

I have a USB drive shared from a Raspberry Pi via Samba.

Everything works fine, but when I disconnect the USB drive, the mounting folder (/media/usb1) still exists and its still being shared through Samba as an empty folder.

What I would have expected is Samba to stop sharing that resource, and appear as disconnected or unavailable in Windows, as its mapped as a network drive.

Is there a way to tell Samba to stop sharing the resource if it’s empty?
Is there any other workaround?

My smb.conf entry for this shared resource is the following:

[usbdrive]
path = /media/usb1
browseable = yes
writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
public = no