diff options
author | Jonathan Bauer | 2015-05-21 16:36:00 +0200 |
---|---|---|
committer | Jonathan Bauer | 2015-05-21 16:36:00 +0200 |
commit | 355ba8bfe3de17894f42b9bc30d67f1105d9eef0 (patch) | |
tree | 0773bfaa2a639ff5fb48c1a34a7a9ebadc03704d /testModule/hooks/pre-mount/fetch-config.sh | |
parent | stage4 blacklists for complete stage4 (diff) | |
download | systemd-init-355ba8bfe3de17894f42b9bc30d67f1105d9eef0.tar.gz systemd-init-355ba8bfe3de17894f42b9bc30d67f1105d9eef0.tar.xz systemd-init-355ba8bfe3de17894f42b9bc30d67f1105d9eef0.zip |
fix return code checks for wget and don't exit in sourced script -.-
Diffstat (limited to 'testModule/hooks/pre-mount/fetch-config.sh')
-rwxr-xr-x | testModule/hooks/pre-mount/fetch-config.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/testModule/hooks/pre-mount/fetch-config.sh b/testModule/hooks/pre-mount/fetch-config.sh index 5151c3b7..a90481c8 100755 --- a/testModule/hooks/pre-mount/fetch-config.sh +++ b/testModule/hooks/pre-mount/fetch-config.sh @@ -10,12 +10,12 @@ SLX_CONFIG_FILE="/opt/openslx/config" if [ -z "$SLX_SERVER" ]; then warn "No 'slxsrv' parameter found in the kernel command line!" warn "Skipping OpenSLX configuration..." - exit 1 + return 1 fi if [ -z "$SLX_BASE" ]; then warn "No 'slxbase' parameter found in the kernel command line!" warn "Skipping OpenSLX configuration..." - exit 1 + return 1 fi info "Getting configuration from OPENSLX-Server..." @@ -23,9 +23,17 @@ WGET="$(busybox which wget)" if [ -z $WGET ]; then # do nothing warn "'wget' not found. Skipping openslx configuration..." - exit 1 + return 1 fi # ok then we are ready to download the config mkdir -p "${SLX_CONFIG_DIR}" $WGET -T 5 -q "http://${SLX_SERVER}/${SLX_BASE}/config" -O "${SLX_CONFIG_FILE}" +RET="$?" +if [ $RET -ne 0 ]; then + warn "Downloading OpenSLX configuration from ${SLX_SERVER}/${SLX_BASE} failed: $RET" + emergency_shell -n "$0" + return 1 +else + return 0 +fi |