summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
Diffstat (limited to 'builder')
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
index f8dcb17b..ae3f959d 100755
--- a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
+++ b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
@@ -21,17 +21,25 @@ slx_server="$(getarg slxsrv=)"
slx_server_base="$(getarg slxbase=)"
exceptions.activate
+# check if system's uuid was set
+if [ -s "/run/system-uuid" ]; then
+ uuid=$(cat "/run/system-uuid")
+ if [ -n "$uuid" ]; then
+ uuid_url="?uuid=$uuid"
+ fi
+fi
+
logging.info "Download SLX configuration from: \"$slx_server\"."
-IFS_backup="$IFS"
+(
IFS=','
for TIMEOUT in 1 1 2 3; do
- if wget --timeout $TIMEOUT \
- "http://${slx_server#@}/${slx_server_base}/${configuration_file_name}" \
- --output-document '/etc/openslx'; then
+ if wget -q -t 2 -T $TIMEOUT \
+ "http://${slx_server#@}/${slx_server_base}/${configuration_file_name}${uuid_url}" \
+ --output-document '/etc/openslx.tmp'; then
break
fi
done
-IFS="$IFS_backup"
+)
if [[ ! -s "/etc/openslx.tmp" ]]; then
logging.warn "Downloading OpenSLX configuration file from any of the servers \"${slx_server}\" at location \"${slx_server_base}/${configuration_file_name}\" failed. Return code: $return_code"