I'm running Hazel 5.1.1 on macOS 10.15.7. Hazel is properly set to have Full Disk Access.
So I set Hazel to look at the folder "/Volumes" and I set the condition to Passes Shell Script, Embedded Script, with this code in the Script:
- Code: Select all
test -d "/Volumes/<volume name>"
if [[ $? -eq 1 ]]
then
exit 0
else
exit 1
fi
When I dismount the volume, the Hazel log shows that it recognizes the change and processes the /Volumes folder....but it doesn't show that it matches and doesn't trigger the action to notify me.
I ran the same code in a test shell script manually in Terminal and it properly returns exit code "0" when the volume is not mounted. My understanding is that exit code 0 tells Hazel to match the condition and run the actions, but it's not doing that for some reason.
Any hints as to what I might be doing wrong? Thanks!