diff options
author | Jonathan Bauer | 2018-03-15 12:41:21 +0100 |
---|---|---|
committer | Jonathan Bauer | 2018-03-15 12:41:21 +0100 |
commit | 9ef72dc6ff925cd4962d788312f24dbba33f3674 (patch) | |
tree | eb020cea689a12d57e41d1dbafaeb2ff8b169424 | |
parent | fix matching physical devices... (diff) | |
download | systemd-init-9ef72dc6ff925cd4962d788312f24dbba33f3674.tar.gz systemd-init-9ef72dc6ff925cd4962d788312f24dbba33f3674.tar.xz systemd-init-9ef72dc6ff925cd4962d788312f24dbba33f3674.zip |
[conf-tgz] do not emergency_shell if SLX_LOCAL_CONFIGURATION is not
set...
-rwxr-xr-x | builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh b/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh index b411381e..752527e3 100755 --- a/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh +++ b/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh @@ -27,31 +27,28 @@ exceptions.catch } # extracted to temporary directory, now check for SLX_LOCAL_CONFIGURATION source "/etc/openslx" -exceptions.try -{ - logging.set_commands_level debug - logging.set_level debug - exceptions.activate - if [[ -z "$SLX_LOCAL_CONFIGURATION" ]]; then - logging.warn "SLX_LOCAL_CONFIGURATION is not set in '/etc/openslx'." - emergency_shell "error in ${BASH_SOURCE[0]}" - fi - if [[ ! -d "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" ]]; then - logging.warn "SLX_LOCAL_CONFIGURATION is set but no corresponding folder found in '/etc/config.tgz'." +if [[ -n "$SLX_LOCAL_CONFIGURATION" ]]; then + exceptions.try + { + logging.set_commands_level debug + logging.set_level debug + exceptions.activate + if [[ ! -d "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" ]]; then + logging.warn "SLX_LOCAL_CONFIGURATION is set but no corresponding folder found in '/etc/config.tgz'." + emergency_shell "error in ${BASH_SOURCE[0]}" + fi + # still here? then process to merge the localized configuration files with the common files. + cd "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" + tar --create --preserve-permissions * | tar --extract --preserve-permissions --directory "${temporary_extract_directory}" + } + exceptions.catch + { + # errors here are not critical, so no emergency shell + logging.error "Failed to merge local configuration files for '$SLX_LOCAL_CONFIGURATION'." + logging.error "$exceptions_last_traceback" emergency_shell "error in ${BASH_SOURCE[0]}" - fi - # still here? then process to merge the localized configuration files with the common files. - cd "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" - tar --create --preserve-permissions * | tar --extract --preserve-permissions --directory "${temporary_extract_directory}" -} -exceptions.catch -{ - # errors here are not critical, so no emergency shell - logging.error "Failed to merge local configuration files for '$SLX_LOCAL_CONFIGURATION'." - logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" -} - + } +fi # now just copy everything from the temporary_extract_directory to the future root exceptions.try { |