add shebang on lib files
This commit is contained in:
parent
9fe99d98dd
commit
1a9758a251
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getConfig() {
|
getConfig() {
|
||||||
while read key value
|
while read key value
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getConfigDestination() {
|
getConfigDestination() {
|
||||||
case "$key" in
|
case "$key" in
|
||||||
'path')
|
'path')
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getConfigGeneral() {
|
getConfigGeneral() {
|
||||||
case $key in
|
case $key in
|
||||||
'max-load')
|
'max-load')
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getConfigSource() {
|
getConfigSource() {
|
||||||
case "$key" in
|
case "$key" in
|
||||||
'path')
|
'path')
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
printConfig() {
|
printConfig() {
|
||||||
{
|
{
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
checkCopy() {
|
checkCopy() {
|
||||||
(
|
(
|
||||||
[ -z "${destinationfrequency[$destination]}" ] \
|
[ -z "${destinationfrequency[$destination]}" ] \
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
copyFiles_action() {
|
copyFiles_action() {
|
||||||
echo '
|
echo '
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
copyFiles_matching() {
|
copyFiles_matching() {
|
||||||
extension="${filename##*.}"
|
extension="${filename##*.}"
|
||||||
cp -al \
|
cp -al \
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
Delete() {
|
Delete() {
|
||||||
#Delete table < where_key where_operator where_value
|
#Delete table < where_key where_operator where_value
|
||||||
# [where_key where_operator where_value
|
# [where_key where_operator where_value
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
Insert() {
|
Insert() {
|
||||||
#Insert table [no_id] < key value
|
#Insert table [no_id] < key value
|
||||||
# [key value
|
# [key value
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
InsertIfUnset() {
|
InsertIfUnset() {
|
||||||
#InsertIfUnset table [no_id] < key value \n key value
|
#InsertIfUnset table [no_id] < key value \n key value
|
||||||
local \
|
local \
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
InsertOrUpdate() {
|
InsertOrUpdate() {
|
||||||
#InsertOrUpdate table set_key set_value [set_key set_value […]] < where_key where_value
|
#InsertOrUpdate table set_key set_value [set_key set_value […]] < where_key where_value
|
||||||
# [where_key where_value
|
# [where_key where_value
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
Select() {
|
Select() {
|
||||||
#Select table [col1 [col2 [..]]] < WHERE_key WHERE_operator WHERE_value
|
#Select table [col1 [col2 [..]]] < WHERE_key WHERE_operator WHERE_value
|
||||||
# [WHERE_key WHERE_operator WHERE_value
|
# [WHERE_key WHERE_operator WHERE_value
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
Update() {
|
Update() {
|
||||||
#Update table set_key set_value [set_key set_value […]] < where_key where_operator where_value
|
#Update table set_key set_value [set_key set_value […]] < where_key where_operator where_value
|
||||||
# [where_key where_operator where_value
|
# [where_key where_operator where_value
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
closeDatabase() {
|
closeDatabase() {
|
||||||
echo .quit >&3
|
echo .quit >&3
|
||||||
(( debug )) && echo -n "Waiting for SQLite to terminate... "
|
(( debug )) && echo -n "Waiting for SQLite to terminate... "
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
openDatabase() {
|
openDatabase() {
|
||||||
if [ ! -d "$tempdir" ]
|
if [ ! -d "$tempdir" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
decodeFile() {
|
decodeFile() {
|
||||||
if ! decodetaskid=$(
|
if ! decodetaskid=$(
|
||||||
Select tasks id <<<"key = $tmpfile"
|
Select tasks id <<<"key = $tmpfile"
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
decodeMpcdec() {
|
decodeMpcdec() {
|
||||||
tmpfile="${fileid}mpcdec"
|
tmpfile="${fileid}mpcdec"
|
||||||
commandline=(mpcdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
commandline=(mpcdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
decodeOpusdec() {
|
decodeOpusdec() {
|
||||||
tmpfile="${fileid}opusdec"
|
tmpfile="${fileid}opusdec"
|
||||||
commandline=(opusdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
commandline=(opusdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
decodeSox() {
|
decodeSox() {
|
||||||
commandline=(sox --single-threaded --temp "$tempdir")
|
commandline=(sox --single-threaded --temp "$tempdir")
|
||||||
soxoptions_in=''
|
soxoptions_in=''
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
createDestinations() {
|
createDestinations() {
|
||||||
for destination in ${!destinationpath[@]}
|
for destination in ${!destinationpath[@]}
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
updateMimes() {
|
updateMimes() {
|
||||||
Update mime_actions action 1 <<<"action != 1"
|
Update mime_actions action 1 <<<"action != 1"
|
||||||
for destination in ${!destinationskipmime[@]}
|
for destination in ${!destinationskipmime[@]}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
encodeFile::mp3() {
|
encodeFile::mp3() {
|
||||||
lameopts=(lame --quiet -v --abr ${destinationquality[$destination]})
|
lameopts=(lame --quiet -v --abr ${destinationquality[$destination]})
|
||||||
[ -n "$album" ] && lameopts+=(--tl "$album" )
|
[ -n "$album" ] && lameopts+=(--tl "$album" )
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
encodeFile::opus() {
|
encodeFile::opus() {
|
||||||
opusencopts=(opusenc --music --quiet)
|
opusencopts=(opusenc --music --quiet)
|
||||||
opusencopts+=(--bitrate ${destinationquality[$destination]})
|
opusencopts+=(--bitrate ${destinationquality[$destination]})
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
encodeFile::vorbis() {
|
encodeFile::vorbis() {
|
||||||
oggencopts=(oggenc -Q -q ${destinationquality[$destination]})
|
oggencopts=(oggenc -Q -q ${destinationquality[$destination]})
|
||||||
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")
|
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getDestDir() {
|
getDestDir() {
|
||||||
destdir="${destinationpath[$destination]}/"
|
destdir="${destinationpath[$destination]}/"
|
||||||
if [ -n "${destinationrenamepath[$destination]}" ]
|
if [ -n "${destinationrenamepath[$destination]}" ]
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getDestFile() {
|
getDestFile() {
|
||||||
if [ -n "${destinationrename[$destination]}" ]
|
if [ -n "${destinationrename[$destination]}" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getFiles() {
|
getFiles() {
|
||||||
scantime=$(date +%s)
|
scantime=$(date +%s)
|
||||||
for prune_expression in "${skippeddirectories[@]}"
|
for prune_expression in "${skippeddirectories[@]}"
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
removeObsoleteFiles() {
|
removeObsoleteFiles() {
|
||||||
Delete source_files <<-EOWhere
|
Delete source_files <<-EOWhere
|
||||||
last_seen < $scantime
|
last_seen < $scantime
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
sanitizeFile() {
|
sanitizeFile() {
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
string="$1"
|
string="$1"
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getInfosAPE_version='APE-1'
|
getInfosAPE_version='APE-1'
|
||||||
tagreaders+=( "$getInfosAPE_version" )
|
tagreaders+=( "$getInfosAPE_version" )
|
||||||
getInfos::APE() {
|
getInfos::APE() {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getInfosFLAC_version='FLAC-1'
|
getInfosFLAC_version='FLAC-1'
|
||||||
tagreaders+=( "$getInfosFLAC_version" )
|
tagreaders+=( "$getInfosFLAC_version" )
|
||||||
getInfos::FLAC() {
|
getInfos::FLAC() {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getInfosMP3_version='ID3-2'
|
getInfosMP3_version='ID3-2'
|
||||||
tagreaders+=( "$getInfosMP3_version" )
|
tagreaders+=( "$getInfosMP3_version" )
|
||||||
getInfos::MP3() {
|
getInfos::MP3() {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getInfosOgg_version='Ogg-1'
|
getInfosOgg_version='Ogg-1'
|
||||||
tagreaders+=( "$getInfosOgg_version" )
|
tagreaders+=( "$getInfosOgg_version" )
|
||||||
getInfos::Ogg() {
|
getInfos::Ogg() {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getInfosOpus_version='Opus-1'
|
getInfosOpus_version='Opus-1'
|
||||||
tagreaders+=( "$getInfosOpus_version" )
|
tagreaders+=( "$getInfosOpus_version" )
|
||||||
getInfos::Opus() {
|
getInfos::Opus() {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getRateChannelMPC() {
|
getRateChannelMPC() {
|
||||||
while read key value garbage
|
while read key value garbage
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getRateChannelSoxi() {
|
getRateChannelSoxi() {
|
||||||
rate=$(soxi -r "$sourcepath/$filename" 2>/dev/null)
|
rate=$(soxi -r "$sourcepath/$filename" 2>/dev/null)
|
||||||
channels=$(soxi -c "$sourcepath/$filename" 2>/dev/null)
|
channels=$(soxi -c "$sourcepath/$filename" 2>/dev/null)
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getTags_version='unknown-2'
|
getTags_version='unknown-2'
|
||||||
tagreaders+=( "$getTags_version" )
|
tagreaders+=( "$getTags_version" )
|
||||||
getTags() {
|
getTags() {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
gettag() {
|
gettag() {
|
||||||
echo -e "$infos" \
|
echo -e "$infos" \
|
||||||
| sed -n "/^${1}=/I{s/^${1}=//I;p;q}"
|
| sed -n "/^${1}=/I{s/^${1}=//I;p;q}"
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
tryAPE() {
|
tryAPE() {
|
||||||
grep -q 'APETAGEX' \
|
grep -q 'APETAGEX' \
|
||||||
"$sourcepath/$filename" \
|
"$sourcepath/$filename" \
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
gettaskinfos() {
|
gettaskinfos() {
|
||||||
echo '
|
echo '
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
progressSpin() {
|
progressSpin() {
|
||||||
case $(( ++count % 40 )) in
|
case $(( ++count % 40 )) in
|
||||||
0) echo -ne '\b|' ;;
|
0) echo -ne '\b|' ;;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
checkworkers() {
|
checkworkers() {
|
||||||
for key in ${!workers[@]}
|
for key in ${!workers[@]}
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
cleaner() {
|
cleaner() {
|
||||||
for key in ${!failedtasks[@]}
|
for key in ${!failedtasks[@]}
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
createworker() {
|
createworker() {
|
||||||
worker $1 &
|
worker $1 &
|
||||||
workers[$1]=$!
|
workers[$1]=$!
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
destroyworker() {
|
destroyworker() {
|
||||||
dyingworker=${workers[$1]}
|
dyingworker=${workers[$1]}
|
||||||
unset workers[$1]
|
unset workers[$1]
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
getworkerid() {
|
getworkerid() {
|
||||||
local i
|
local i
|
||||||
for (( i=0 ; i >= 0 ; i++ ))
|
for (( i=0 ; i >= 0 ; i++ ))
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
master() {
|
master() {
|
||||||
if (( active >= concurrency)) || [ -n "$quit" ]
|
if (( active >= concurrency)) || [ -n "$quit" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
worker() {
|
worker() {
|
||||||
exec 2>>"$tempdir/worker$1.log"
|
exec 2>>"$tempdir/worker$1.log"
|
||||||
(( debug >= 2 )) && echo "${cmd_arg[@]}" >&2
|
(( debug >= 2 )) && echo "${cmd_arg[@]}" >&2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user