diff options
author | Simon Rettberg | 2013-06-20 17:18:03 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-06-20 17:18:03 +0200 |
commit | 3037959b37c6cdfd9a2b43ec9b33e9470c0d8f2e (patch) | |
tree | 2bb704ab74c545366cbeda3c32c5ad39bb71e7b4 /remote/rootfs/rootfs-stage32/data/opt/openslx/bin | |
parent | [vmplayer] Wait for host's udhcpc to write DNS servers to config before gener... (diff) | |
download | tm-scripts-3037959b37c6cdfd9a2b43ec9b33e9470c0d8f2e.tar.gz tm-scripts-3037959b37c6cdfd9a2b43ec9b33e9470c0d8f2e.tar.xz tm-scripts-3037959b37c6cdfd9a2b43ec9b33e9470c0d8f2e.zip |
[rootfs-stage31/32] Try to download slxconfig in stage31 already, retry in stage32 if it failed
Diffstat (limited to 'remote/rootfs/rootfs-stage32/data/opt/openslx/bin')
-rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig index fe02d7eb..dbe23b21 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig @@ -1,6 +1,12 @@ #!/bin/bash -export PATH=/opt/openslx/bin:/opt/openslx/usr/bin +if [ $# -gt 0 ]; then + CONFIG="$1/opt/openslx/config" +else + CONFIG="/opt/openslx/config" +fi + +[ -e "$CONFIG" ] && grep '^#_RCONFIG_TAG$' "$CONFIG" > /dev/null && echo "Config already fetched." && exit 0 URL="$(grep -o -E "slxconfig=\S+" /proc/cmdline | cut -c 11-)" @@ -9,13 +15,14 @@ if [ -z "$URL" ]; then exit 1 fi -wget -q -O "/opt/openslx/config-remote" "$URL" +wget -T 5 -q -O "${CONFIG}-remote" "$URL" RET=$? if [ "x$RET" != "x0" ]; then echo "Error - downloading '$URL' via wget failed. Exit Code: $RET" exit 1 fi -echo "# Config fetched from $URL" >> "/opt/openslx/config" -cat "/opt/openslx/config-remote" >> "/opt/openslx/config" +echo "# Config fetched from $URL" >> "$CONFIG" +echo "#_RCONFIG_TAG" >> "$CONFIG" +cat "${CONFIG}-remote" >> "$CONFIG" exit 0 |