use glabal lib for moviedir set
This commit is contained in:
parent
c533881fac
commit
01086b336c
@ -54,20 +54,16 @@ fi
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
##check & prepair args
|
## Checks
|
||||||
[ "${mode:0:1}" == "e" ] && touch "$md5list"
|
[ "${mode:0:1}" == "e" ] && touch "$md5list" || {
|
||||||
[ -f "$md5list" ] || { echo "md5list \"$md5list\" do not exist"; exit 1; } # check md5
|
echo "ERROR: cant creat MD5 File on this PLACE"
|
||||||
[ -z "$moviedir" ] && [ -f "$globalconf" ] && { # if (no argument) and (globalconf exist)
|
exit 1
|
||||||
if [ -z "$(grep "moviedir=" "$globalconf" )" ]; then # and (moviedir is NOT in globalconf)
|
}
|
||||||
echo 'neither "movie folder" is set in global config nor given as argument'
|
# check if md5 file exist
|
||||||
exit 2
|
[ -f "$md5list" ] || {
|
||||||
else # and (moviedir is in globalconf)
|
echo "md5list \"$md5list\" do not exist"
|
||||||
moviedir="$(grep "moviedir=" "$globalconf" | cut -d '=' -f 2)"
|
exit 1
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
[ -d "$moviedir" ] || { echo "moviedir \"$moviedir\" do not exist"; exit 3; } # check moviedir
|
|
||||||
moviedir=""$(echo $moviedir | sed 's|/$||g')""
|
|
||||||
[ -z "$moviedir" ] && exit 255 #catch case moviedir="/"
|
|
||||||
|
|
||||||
#db checks
|
#db checks
|
||||||
[ "$(db_check)" == $FALSE ] && {
|
[ "$(db_check)" == $FALSE ] && {
|
||||||
|
Loading…
Reference in New Issue
Block a user