bugfix moviedir set routine
This commit is contained in:
parent
ad243b61fe
commit
ffb1b34d5e
@ -71,12 +71,12 @@ function config_load() {
|
|||||||
#set moviedir
|
#set moviedir
|
||||||
{
|
{
|
||||||
moviedir="$(echo $moviedir | sed 's|/$||g')" #remove last '/'
|
moviedir="$(echo $moviedir | sed 's|/$||g')" #remove last '/'
|
||||||
[ -z "$moviedir" ] && [ -d "$globalconf" ] && { # if (no argument) and (globalconf exist)
|
[ -z "$moviedir" ] && [ -f "$config" ] && { # if (no argument) and (globalconf exist)
|
||||||
if [ -z "$(grep "moviedir=" "$globalconf" )" ]; then # and (moviedir is NOT in globalconf)
|
if [ -z "$(grep "moviedir=" "$config" )" ]; then # and (moviedir is NOT in globalconf)
|
||||||
echo 'ERROR: NO Guilty moviedir SET'
|
echo 'ERROR: NO Guilty moviedir SET'
|
||||||
exit $ERROR_CONFIG
|
exit $ERROR_CONFIG
|
||||||
else # and (moviedir is in globalconf)
|
else # and (moviedir is in globalconf)
|
||||||
readonly moviedir="$(grep "moviedir=" "$globalconf" | cut -d '=' -f 2 | tr -d '"' | sed 's|/$||g')"
|
readonly moviedir="$(grep "moviedir=" "$config" | cut -d '=' -f 2 | tr -d '"' | sed 's|/$||g')"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
[ -d "$moviedir" ] || {
|
[ -d "$moviedir" ] || {
|
||||||
|
@ -20,7 +20,7 @@ fi
|
|||||||
|
|
||||||
#get options & args
|
#get options & args
|
||||||
readonly mode=$(echo $1 | tr -d '-')
|
readonly mode=$(echo $1 | tr -d '-')
|
||||||
[ -n "$1" ] && moviedir="$1"
|
[ -n "$1" ] && [ -d "$1" ] && moviedir="$1"
|
||||||
readonly DATE=$(date '+%Y-%m-%d')
|
readonly DATE=$(date '+%Y-%m-%d')
|
||||||
|
|
||||||
#help function
|
#help function
|
||||||
|
Loading…
Reference in New Issue
Block a user