diff --git a/lib/zzz_main_fct.sh b/lib/zzz_main_fct.sh index 5d11f21..daac027 100644 --- a/lib/zzz_main_fct.sh +++ b/lib/zzz_main_fct.sh @@ -296,10 +296,16 @@ process_commandline_and_vars() # Check for module list existance and basic syntax if [[ -n $MODULE_LIST ]]; then - if [[ $(echo $MODULE_LIST | grep '-') ]]; then - prnt E "Dash is forbidden in module name." - die 5 - fi + for $mod in $MODULE_LIST; do + if [[ $mod =~ ['\"\'\ \\-!@#$%&*=+'] ]]; then + prnt E "The module \"$mod\" contains a forbidden character in its name." + die 5 + 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 prnt E "No module to execute!" die 5