Fixed usage message and output improvements.

This commit is contained in:
Christoph Niethammer 2016-09-08 09:02:13 +00:00
parent d710e1f528
commit d2e6276d35

View file

@ -6,10 +6,8 @@
#
function print_usage() {
echo <<EOT
Script checking the module environment for problems during module loading/unloading
usage: $0 [MODULE_PATTERN] [--exclude PATTERN]"
EOT
echo "Script checking the module environment for problems during module loading/unloading"
echo "usage: $0 [MODULE_PATTERN] [--exclude PATTERN]"
}
# Command line options:
@ -38,9 +36,8 @@ done
Color_Off='\e[0m' # Text Reset
IGreen='\e[0;92m' # Intense Green
IRed='\e[0;91m' # Intense Red
IMagenta='\e[0;95m' # magenta
echo Moduleclasses: ${moduleclasses[@]}
echo Exclude: ${exclude_patterns[@]}
# intermediate files, logfiles
LOGDIR=${LOGDIR:=$PWD}
tmpdir=/tmp/check_modules-$USER
@ -66,6 +63,9 @@ echo "Host: $(/bin/hostname)" | tee -a $logfile
echo "USER: $USER" | tee -a $logfile
echo "Logfile: $logfile" | tee -a $logfile
echo "--------------------" | tee -a $logfile
echo Moduleclasses: ${moduleclasses[@]} | tee -a $logfile
echo Exclude: ${exclude_patterns[@]} | tee -a $logfile
echo "--------------------" | tee -a $logfile
echo "Environment:" >> $logfile
cat $module_clean_env_file >> $logfile
echo "--------------------" >> $logfile
@ -77,8 +77,9 @@ do
for exclude_pattern in ${exclude_patterns[@]}
do
if [[ "$m_original" =~ "$exclude_pattern" ]]; then
echo MATCH: $exclude_pattern
echo -e "Skipping $m_original (matches $exclude_pattern) ... ${IMagenta} skipped${Color_Off}"
match=1
continue
fi
done
if [ $match == 1 ]; then