#!/bin/bash # # Check for playlist files. # # Parameters BASENAME="`basename $0`" PLAYLIST="$1" MEDIA="/var/cache/media/noise" PLAYLISTS="$MEDIA/playlists" # Basic syntax if [ -z "$PLAYLIST" ]; then echo "Usage: $BASENAME " if [ -d "$PLAYLISTS" ]; then echo "" echo "Available playlists: " ls $PLAYLISTS fi exit 1 elif [ ! -f "$PLAYLISTS/$PLAYLIST.m3u" ]; then echo "No such playlist $PLAYLISTS/$PLAYLIST.m3u" exit 1 fi # Prepare cd $MEDIA # Process cat $PLAYLISTS/$PLAYLIST.m3u | while read file; do if [ ! -e "$file" ]; then echo "missing file: $file" fi done