From 196829ecc566353827fd6419bb5a8ae258eacdb9 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 9 Jan 2019 12:56:37 +0100 Subject: [conf*] formatting (space -> tabs) --- .../modules.d/conf-tgz/hooks/fetch-config-tgz.sh | 9 +-- .../modules.d/conf-tgz/hooks/unpack-config-tgz.sh | 74 +++++++++++----------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/builder/modules.d/conf-tgz/hooks/fetch-config-tgz.sh b/builder/modules.d/conf-tgz/hooks/fetch-config-tgz.sh index eb32cfda..aaf8db2f 100755 --- a/builder/modules.d/conf-tgz/hooks/fetch-config-tgz.sh +++ b/builder/modules.d/conf-tgz/hooks/fetch-config-tgz.sh @@ -27,15 +27,16 @@ exceptions.try # to stay compatible with busybox's wget we do not use '--tries' for TIMEOUT in 1 1 2 3; do if wget -q -T $TIMEOUT \ - "http://${slx_server#@}/${slx_server_base}/config.tgz$uuid_url" \ - --output-document "/etc/config.tgz"; then - break + "http://${slx_server#@}/${slx_server_base}/config.tgz$uuid_url" \ + --output-document "/etc/config.tgz"; then + break fi done IFS="$IFS_backup" if [[ ! -e "/etc/config.tgz" ]]; then - logging.warn "Downloading 'config.tgz' from '${slx_server}' failed. Return code: $return_code" + logging.warn \ + "Downloading 'config.tgz' from '${slx_server}' failed with: $return_code" return 1 fi } 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 5d3b1c6f..7bae4713 100755 --- a/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh +++ b/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh @@ -10,55 +10,55 @@ type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh temporary_extract_directory="$(mktemp -d)" exceptions.try { - exceptions.activate - if [[ -e "/etc/config.tgz" ]]; then - tar --extract --preserve-permissions \ - --file="/etc/config.tgz" \ - --directory="$temporary_extract_directory" - chown -R 0:0 "$temporary_extract_directory" - fi + exceptions.activate + if [[ -e "/etc/config.tgz" ]]; then + tar --extract --preserve-permissions \ + --file="/etc/config.tgz" \ + --directory="$temporary_extract_directory" + chown -R 0:0 "$temporary_extract_directory" + fi } exceptions.catch { - logging.error "Failed to extract '/etc/config.tgz' to '$temporary_extract_directory'." - logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" + logging.error "Failed to extract '/etc/config.tgz' to '$temporary_extract_directory'." + logging.error "$exceptions_last_traceback" + emergency_shell "error in ${BASH_SOURCE[0]}" } # extracted to temporary directory, now check for SLX_LOCAL_CONFIGURATION source "/etc/openslx" if [[ -n "$SLX_LOCAL_CONFIGURATION" ]]; then - exceptions.try - { - 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]}" - } + exceptions.try + { + 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 # now just copy everything from the temporary_extract_directory to the future root exceptions.try { - exceptions.activate - cd "${temporary_extract_directory}" - # purge openslx-configs/ - rm -rf "openslx-configs" - tar --create --preserve-permissions * | tar --extract --preserve-permissions --directory "${NEWROOT}" + exceptions.activate + cd "${temporary_extract_directory}" + # purge openslx-configs/ + rm -rf "openslx-configs" + tar --create --preserve-permissions * | tar --extract --preserve-permissions --directory "${NEWROOT}" } exceptions.catch { - # errors here are not critical, so no emergency shell - logging.error "Failed to copy extracted configuration files to '$NEWROOT'." - logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" + # errors here are not critical, so no emergency shell + logging.error "Failed to copy extracted configuration files to '$NEWROOT'." + logging.error "$exceptions_last_traceback" + emergency_shell "error in ${BASH_SOURCE[0]}" } -- cgit v1.2.3-55-g7522