print config
This commit is contained in:
parent
0f52325ac0
commit
9fe99d98dd
39
atom
39
atom
@ -56,12 +56,15 @@ done
|
|||||||
|
|
||||||
#parse arguments
|
#parse arguments
|
||||||
OPTERR=0
|
OPTERR=0
|
||||||
while getopts ':c:l:T:F:hD' opt
|
while getopts ':c:Cl:T:F:hD' opt
|
||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
c)
|
c)
|
||||||
cffile="$OPTARG"
|
cffile="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
C)
|
||||||
|
cfgdump=1
|
||||||
|
;;
|
||||||
l)
|
l)
|
||||||
cliload="$OPTARG"
|
cliload="$OPTARG"
|
||||||
;;
|
;;
|
||||||
@ -112,38 +115,8 @@ fi
|
|||||||
getConfig
|
getConfig
|
||||||
|
|
||||||
set +H
|
set +H
|
||||||
if (( debug ))
|
(( debug || cfgdump )) && printConfig
|
||||||
then
|
(( cfgdump )) && exit
|
||||||
cat <<-EOF
|
|
||||||
General|Load|$maxload
|
|
||||||
|Load Interval|$loadinterval
|
|
||||||
|Temp Dir|$tempdir
|
|
||||||
|Database|$database
|
|
||||||
|Debug|$debug
|
|
||||||
Source|Path|$sourcepath
|
|
||||||
EOF
|
|
||||||
for prune_expression in "${skippeddirectories[@]}"
|
|
||||||
do
|
|
||||||
echo "|Skipped directory|$prune_expression"
|
|
||||||
done
|
|
||||||
for destination in ${!destinationpath[@]}
|
|
||||||
do
|
|
||||||
cat <<-EOF
|
|
||||||
$destination|Path|${destinationpath[$destination]}
|
|
||||||
|Format|${destinationformat[$destination]}
|
|
||||||
|Quality|${destinationquality[$destination]}
|
|
||||||
|Normalize|${destinationnormalize[$destination]}
|
|
||||||
|Channels|${destinationchannels[$destination]}
|
|
||||||
|Frequency|${destinationfrequency[$destination]}
|
|
||||||
|Path Change|${destinationrenamepath[$destination]}
|
|
||||||
|File Rename|${destinationrename[$destination]}
|
|
||||||
EOF
|
|
||||||
echo "|Skipped mime-type|${destinationskipmime[$destination]//\|/
|
|
||||||
|Skipped mime-type|}"
|
|
||||||
echo "|Copied mime-type|${destinationcopymime[$destination]//\|/
|
|
||||||
|Copied mime-type|}"
|
|
||||||
done
|
|
||||||
fi |column -t -s'|' -n
|
|
||||||
|
|
||||||
openDatabase
|
openDatabase
|
||||||
|
|
||||||
|
|||||||
51
lib/config/print
Normal file
51
lib/config/print
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
printConfig() {
|
||||||
|
{
|
||||||
|
cat <<-EOF
|
||||||
|
General|Load|$maxload
|
||||||
|
|Load Interval|$loadinterval
|
||||||
|
|Temp Dir|$tempdir
|
||||||
|
|Database|$database
|
||||||
|
|Debug|$debug
|
||||||
|
Source|Path|$sourcepath
|
||||||
|
EOF
|
||||||
|
for prune_expression in "${skippeddirectories[@]}"
|
||||||
|
do
|
||||||
|
(( printed )) \
|
||||||
|
&& echo -n '||' \
|
||||||
|
|| echo -n '|Skipped directories|'
|
||||||
|
echo "$prune_expression"
|
||||||
|
printed=1
|
||||||
|
done
|
||||||
|
unset printed
|
||||||
|
for destination in ${!destinationpath[@]}
|
||||||
|
do
|
||||||
|
cat <<-EOF
|
||||||
|
$destination|Path|${destinationpath["$destination"]}
|
||||||
|
|Format|${destinationformat["$destination"]}
|
||||||
|
|Quality|${destinationquality["$destination"]}
|
||||||
|
EOF
|
||||||
|
if [[ ${destinationformat["$destination"]} == opus ]]
|
||||||
|
then
|
||||||
|
echo "|Expected loss|${destinationloss["$destination"]}"
|
||||||
|
elif [[ ${destinationformat["$destination"]} == mp3 ]]
|
||||||
|
then
|
||||||
|
echo "|Prevent resampling|${destinationnoresample["$destination"]}"
|
||||||
|
fi
|
||||||
|
cat <<-EOF
|
||||||
|
|Normalize|${destinationnormalize["$destination"]}
|
||||||
|
|Channels|${destinationchannels["$destination"]}
|
||||||
|
|Frequency|${destinationfrequency["$destination"]}
|
||||||
|
|Higher than|${destinationmaxbps["$destination"]}
|
||||||
|
|Fat32 Compat.|${destinationfat32compat["$destination"]}
|
||||||
|
|Path Change|${destinationrenamepath["$destination"]}
|
||||||
|
|File Rename|${destinationrename["$destination"]}
|
||||||
|
EOF
|
||||||
|
[ -n "${destinationskipmime["$destination"]}" ] \
|
||||||
|
&& echo "|Skipped mime-types|${destinationskipmime["$destination"]//\|/
|
||||||
|
||}"
|
||||||
|
[ -n "${destinationmskipime["$destination"]}" ] \
|
||||||
|
&& echo "|Copied mime-types|${destinationcopymime["$destination"]//\|/
|
||||||
|
||}"
|
||||||
|
done
|
||||||
|
}|column -t -s'|' -n
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user