diff options
author | Simon Rettberg | 2024-01-31 17:54:54 +0100 |
---|---|---|
committer | Simon Rettberg | 2024-01-31 17:54:54 +0100 |
commit | acacfde5da4c681eb2bce75e87a10a88e1cd10d3 (patch) | |
tree | 32334922bd48bf36f6178d842729806666565d5a /modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh | |
parent | [busybox] Split into services (diff) | |
download | systemd-init-acacfde5da4c681eb2bce75e87a10a88e1cd10d3.tar.gz systemd-init-acacfde5da4c681eb2bce75e87a10a88e1cd10d3.tar.xz systemd-init-acacfde5da4c681eb2bce75e87a10a88e1cd10d3.zip |
De-dracutize service-scripts, try to use ash where applicable
Diffstat (limited to 'modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh')
-rwxr-xr-x | modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh b/modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh index 2ed5f579..1d032a19 100755 --- a/modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh +++ b/modules.d/conf-tgz/hooks/s3-fetch-config-tgz.sh @@ -1,27 +1,27 @@ -#!/usr/bin/env bash +#!/bin/ash # -*- coding: utf-8 -*- -type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh - . /etc/openslx -if [ -z "$SLX_NO_CONFIG_TGZ" ]; then - # build config.tgz url from SLX_KCL_SERVERS and SLX_BASE_PATH - # both are written to /etc/openslx by dnbd3-rootfs's s3-fetch-config.sh script - conftgz_url="http://${SLX_KCL_SERVERS}/${SLX_BASE_PATH}/config.tgz" +[ -n "$SLX_NO_CONFIG_TGZ" ] && exit 0 - # check if system's uuid was set - if [ -s "/run/system-uuid" ]; then - uuid="$(cat /run/system-uuid)" - if [ -n "$uuid" ]; then - conftgz_url="${conftgz_url}?uuid=${uuid}" - fi - fi - info "Download config.tgz from '$conftgz_url'..." - slx-tools download_retry --slx-time 20 -sS "${conftgz_url}" > "/etc/config.tgz" +# build config.tgz url from SLX_KCL_SERVERS and SLX_BASE_PATH +# both are written to /etc/openslx by dnbd3-rootfs's s3-fetch-config.sh script +conftgz_url="http://${SLX_KCL_SERVERS}/${SLX_BASE_PATH}/config.tgz" - if [[ ! -s "/etc/config.tgz" ]]; then - warn "Failed to download '${conftgz_url}'!" +# check if system's uuid was set +if [ -s "/run/system-uuid" ]; then + uuid="$(cat /run/system-uuid)" + if [ -n "$uuid" ]; then + conftgz_url="${conftgz_url}?uuid=${uuid}" fi fi -: +echo "Download config.tgz from '$conftgz_url'..." +slx-tools download_retry --slx-time 20 -sS "${conftgz_url}" > "/etc/config.tgz" + +if ! [ -s "/etc/config.tgz" ]; then + echo "Failed to download '${conftgz_url}'" + exit 1 +fi + +exit 0 |