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