diff options
Diffstat (limited to 'builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh')
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh index a1f8995c..a11332a7 100755 --- a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh +++ b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh @@ -1,21 +1,11 @@ #!/usr/bin/env bash # -*- coding: utf-8 -*- # region imports -source '/usr/lib/rebash/core.sh' -core.import exceptions -core.import logging type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh # endregion -exceptions.try -{ -logging.set_log_file "${SLX_LOG_FILE_PATH:-/var/log/openslx}" - -# NOTE: "getarg" raises an exception so deactivate exceptions for now. -exceptions.deactivate slx_server="$(getarg slxsrv=)" slx_server_base="$(getarg slxbase=)" -exceptions.activate # build config_url config_url="http://${slx_server#@}/${slx_server_base}/config" @@ -30,16 +20,16 @@ fi config_path="/etc/openslx.tmp" -logging.info "Downloading '$config_url'..." +echo "Downloading '$config_url'..." slx-tools download_retry -s "$config_url" > "$config_path" if [ ! -s "$config_path" ] ; then - logging.warn "Downloading OpenSLX configuration file from '$config_url' failed with: $return_code" + warn "Downloading OpenSLX configuration file from '$config_url' failed with: $return_code" emergency_shell "CRITICAL: System unusable." fi if ! ash -n "$config_path"; then - logging.warn "Downloaded OpenSLX configuration failed syntax check!" + warn "Downloaded OpenSLX configuration failed syntax check!" emergency_shell "CRITICAL: System unusable." fi @@ -57,14 +47,4 @@ cat "$config_path" >> /etc/openslx # slxsrv overrides SLX_DNBD3_SERVERS if prefixed with @ [ "${slx_server#@}" != "${slx_server}" ] && sed -i "s/^SLX_DNBD3_SERVERS=.*/SLX_DNBD3_SERVERS='${slx_server#@}'/" "/etc/openslx" - -} -exceptions.catch -{ - logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" -} -# region vim modline -# vim: set tabstop=4 shiftwidth=4 expandtab: -# vim: foldmethod=marker foldmarker=region,endregion: -# endregion +true |