summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
diff options
context:
space:
mode:
authorJonathan Bauer2020-05-13 11:04:02 +0200
committerJonathan Bauer2020-05-13 11:04:02 +0200
commit1130873aa55c9b0a7e5af48edc44bd6c6fd1f888 (patch)
tree0fcfa186cd631d8d36611b3d4bc509fd38841d51 /builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
parentMerge branch 'centos8' into downloader (diff)
downloadsystemd-init-1130873aa55c9b0a7e5af48edc44bd6c6fd1f888.tar.gz
systemd-init-1130873aa55c9b0a7e5af48edc44bd6c6fd1f888.tar.xz
systemd-init-1130873aa55c9b0a7e5af48edc44bd6c6fd1f888.zip
restructure repo
* remove packager * move everything from builder/* back to root
Diffstat (limited to 'builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh')
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh50
1 files changed, 0 insertions, 50 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
deleted file mode 100755
index a11332a7..00000000
--- a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-# -*- coding: utf-8 -*-
-# region imports
-type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh
-# endregion
-
-slx_server="$(getarg slxsrv=)"
-slx_server_base="$(getarg slxbase=)"
-
-# build config_url
-config_url="http://${slx_server#@}/${slx_server_base}/config"
-
-# check if system's uuid was set
-if [ -s "/run/system-uuid" ]; then
- uuid=$(cat "/run/system-uuid")
- if [ -n "$uuid" ]; then
- config_url="${config_url}?uuid=${uuid}"
- fi
-fi
-
-config_path="/etc/openslx.tmp"
-
-echo "Downloading '$config_url'..."
-slx-tools download_retry -s "$config_url" > "$config_path"
-
-if [ ! -s "$config_path" ] ; then
- warn "Downloading OpenSLX configuration file from '$config_url' failed with: $return_code"
- emergency_shell "CRITICAL: System unusable."
-fi
-
-if ! ash -n "$config_path"; then
- warn "Downloaded OpenSLX configuration failed syntax check!"
- emergency_shell "CRITICAL: System unusable."
-fi
-
-# remember kcl server and base
-{
- echo "SLX_KCL_SERVERS='$slx_server'"
- echo "SLX_BASE_PATH='$slx_server_base'"
- echo "# Config fetched from $config_url"
- echo "CONFIG_DOWNLOAD_TIME=$(sed -r 's/^([0-9]+)\.([0-9]+).*$/\1\2/' /proc/uptime)"
- echo '#_RCONFIG_TAG'
-} > /etc/openslx
-
-# finally copy remote config into it
-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"
-true