From 4ef135c6ab9c626fc9d714e441518de869bd5de7 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 9 Jun 2021 10:01:13 +0200 Subject: [PATCH] modulecmd: soure Pmodules.conf only if exist and readable --- Pmodules/modulecmd.bash.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index fd74b0c..c6d822b 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1421,10 +1421,11 @@ init_manpath() { } pmodules_init() { - source "${pmodules_config_file}" || \ - std::die 3 "Oops: cannot parse config file -- %s\n" \ - "${pmodules_config_file}" - + if [[ -r "${pmodules_config_file}" ]]; then + source "${pmodules_config_file}" || \ + std::die 3 "Oops: cannot parse config file -- %s\n" \ + "${pmodules_config_file}" + fi declare -gx LOADEDMODULES='' declare -gx _LMFILES_='' declare -gx UsedGroups=''