I'm trying to find a way to do this. Right now I have a script that will only allow samba to be reset by running "smbstatus", but it isn't very reliable (shows locked files when a Windows client has mapped a share, with no file activity).
Is there any way to detect when Samba has files being transferred?
NOTE: Only active file transfers, not mapped clients
EDIT: Here is what my script looks like
until sudo smbstatus | grep "No locked files" do echo "Processes Running..." sleep 5 echo "" done sudo service smbd restart echo "Restarted SMB"