zzz_main.sh: do more checks arround module list

This commit is contained in:
levasseur
2021-12-17 16:12:07 +01:00
parent 40226a8ab3
commit 7d0fa69a5a

View File

@@ -296,10 +296,16 @@ process_commandline_and_vars()
# Check for module list existance and basic syntax # Check for module list existance and basic syntax
if [[ -n $MODULE_LIST ]]; then if [[ -n $MODULE_LIST ]]; then
if [[ $(echo $MODULE_LIST | grep '-') ]]; then for $mod in $MODULE_LIST; do
prnt E "Dash is forbidden in module name." if [[ $mod =~ ['\"\'\ \\-!@#$%&*=+'] ]]; then
prnt E "The module \"$mod\" contains a forbidden character in its name."
die 5 die 5
fi fi
if [[ ! -s "modules/$mod.sh" ]]; then
prnt E "The asked module \"$mod\", doesn't have any module file or module file is empty."
die 18
fi
done
else else
prnt E "No module to execute!" prnt E "No module to execute!"
die 5 die 5