commit 3e05da45dfcf81667f313fdb3bb8a13fb74badd2 Hiltjo Posthuma <hiltjo@codemadness.org> 2015-01-23 13:21:53 +0100 scripts/sad-add: check if path is a unix domain socket before trying stuff
scripts/sad-add | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/sad-add b/scripts/sad-add index a0f193d..97efe39 100755 --- a/scripts/sad-add +++ b/scripts/sad-add @@ -2,12 +2,17 @@ sock="/tmp/sad-sock" paths="$HOME/music" +if ! test -S "$sock"; then + echo "$0: no unix domain socket at: ${sock}" >&2 + exit 1 +fi + while read -r p; do # absolute paths. d=$(readlink -f "$p") test -d "$d" || continue - # find mpg, ogg, wav files in specified path - # make an add command and pipe it to the UDS. + # find mpg, ogg, flac, wav files in specified path make an add command + # and pipe it to the UDS. find "$d" -type f \ \( -iname "*.mp3" -or \ -iname "*.ogg" -or \