Update watch.sh

This commit is contained in:
Jelle Jansen 2025-04-12 16:57:51 +02:00
parent dc4ed4678b
commit 5e717c6e33

View File

@ -8,13 +8,13 @@ extract_audio() {
} }
# Begin de loop om de map in de gaten te houden # Begin de loop om de map in de gaten te houden
inotifywait -m -r -e create /watched --format '%w%f' | while read FILE inotifywait -m -r -e create --format '%w%f' /watched | while read FILE
do do
# Wacht tot het bestand volledig is geschreven # Wacht tot het bestand volledig is geschreven
sleep 1 sleep 1
# Controleer of het bestand een video- of audio-bestand is # Controleer of het bestand een video- of audio-bestand is
if [[ "$FILE" == *.mp4 || "$FILE" == *.MP4 || "$FILE" == *.avi ]]; then if [[ "$FILE" == *.mp4 || "$FILE" == *.MP4 || "$FILE" == *.avi || "$FILE" == *.mov || "$FILE" == *.flv || "$FILE" == *.wmv ]]; then
echo "Nieuw bestand gedetecteerd: $FILE" echo "Nieuw bestand gedetecteerd: $FILE"
extract_audio "$FILE" extract_audio "$FILE"
fi fi