truckerDave
Well-Known Member
The setup .... Linux Mint Virginia fresh install with Zoneminder (security camera program)
For my front door cam, I have created a simple bash script
which monitors the directory for the snapshot.jpg being added any time there is motion detected. Which does what it was intended.
Then I created a service ...
to run the bash at startup.
The issue I am having is I can run
Is this a permissions issue? I've tried changing the files from dave to root.
I've, also, tried using an mp3. Both the wav and mp3 play fine from terminal. And I tried adding a
Any ideas?????
Maybe a better way than ffmpeg to play an audio file for my purpose????
For my front door cam, I have created a simple bash script
Code:
#!/bin/bash
inotifywait -m -r /var/cache/zoneminder/events/ -e create -e moved_to |
while read -r directory action file; do
if [[ "$file" =~ snapshot.jpg$ ]]; then
ffplay -nodisp -hide_banner -autoexit usr/doorbell.wav
fi
done
Then I created a service ...
Code:
[Unit]
Description=My Test Bash Script
After=zoneminder.service
[Service]
Type=simple
ExecStart=/usr/doorbell.sh
[Install]
WantedBy=multi-user.target
The issue I am having is I can run
ffplay -nodisp -hide_banner -autoexit usr/doorbell.wav
in the terminal and the sound file plays perfectly. However, when triggered through the service/bash, it just plays a quiet short tone. Is this a permissions issue? I've tried changing the files from dave to root.
I've, also, tried using an mp3. Both the wav and mp3 play fine from terminal. And I tried adding a
sleep 5
to the bash thinking maybe it was exiting prior to the sound file fully playing.Any ideas?????
Maybe a better way than ffmpeg to play an audio file for my purpose????