zzz_main.sh: do more checks arround module list
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user