54 lines
1.0 KiB
Bash
54 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
setupSource() {
|
|
cat <<-EODesc
|
|
|
|
[Source]
|
|
Here we will define which directory AtOM should look for media files, and
|
|
what it should completely ignore.
|
|
EODesc
|
|
cat <<-EODesc
|
|
|
|
Path (path):
|
|
Which directory to scan for new media files.
|
|
EODesc
|
|
comeagain() {
|
|
read \
|
|
-e \
|
|
-i"${sourcepath:-/var/lib/mpd/music}" \
|
|
-p'Music collection (<TAB> for completion): ' \
|
|
sourcepath
|
|
if ! [ -d "$sourcepath" ]
|
|
then
|
|
echo "$sourcepath does not exist or is not a" \
|
|
"directory!" >&2
|
|
comeagain
|
|
fi
|
|
}
|
|
comeagain
|
|
cat <<-EODesc
|
|
|
|
Skip (path):
|
|
Files in these directories will be ignored.
|
|
Path is relative to $sourcepath.
|
|
|
|
This prompt will loop until an empty string is encountered.
|
|
EODesc
|
|
cd "$sourcepath"
|
|
for (( i=0 ; 1 ; i++ ))
|
|
do
|
|
read \
|
|
-e \
|
|
${skippeddirectories[i]+-i"${skippeddirectories[i]}"}\
|
|
-p'Skip: ' \
|
|
value
|
|
if [ -n "$value" ]
|
|
then
|
|
skippeddirectories[i]="$value"
|
|
else
|
|
break
|
|
fi
|
|
done
|
|
cd - >/dev/null
|
|
}
|