bugfix moviedir set routine

This commit is contained in:
6543 2019-05-12 00:29:37 +02:00
parent ad243b61fe
commit ffb1b34d5e
2 changed files with 4 additions and 4 deletions

View File

@ -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" ] || {

View File

@ -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