summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-03-15 12:41:21 +0100
committerJonathan Bauer2018-03-15 12:41:21 +0100
commit9ef72dc6ff925cd4962d788312f24dbba33f3674 (patch)
treeeb020cea689a12d57e41d1dbafaeb2ff8b169424
parentfix matching physical devices... (diff)
downloadsystemd-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-xbuilder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh45
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
{