diff options
author | Jonathan Bauer | 2015-05-08 15:42:44 +0200 |
---|---|---|
committer | Jonathan Bauer | 2015-05-08 15:42:44 +0200 |
commit | e2a44a9c03afe840b82e0a7b79a6113c15426bbf (patch) | |
tree | c83f6faeaffd2c9c2e7499e35fc2e9627fec3f36 /testModule/hooks/pre-mount/fetch-config.sh | |
parent | started configuration stuff (diff) | |
download | systemd-init-e2a44a9c03afe840b82e0a7b79a6113c15426bbf.tar.gz systemd-init-e2a44a9c03afe840b82e0a7b79a6113c15426bbf.tar.xz systemd-init-e2a44a9c03afe840b82e0a7b79a6113c15426bbf.zip |
fix the cmdline hack for parsing ip config - now is statically set
Diffstat (limited to 'testModule/hooks/pre-mount/fetch-config.sh')
-rwxr-xr-x | testModule/hooks/pre-mount/fetch-config.sh | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/testModule/hooks/pre-mount/fetch-config.sh b/testModule/hooks/pre-mount/fetch-config.sh index 013b0058..5151c3b7 100755 --- a/testModule/hooks/pre-mount/fetch-config.sh +++ b/testModule/hooks/pre-mount/fetch-config.sh @@ -1,12 +1,31 @@ -command -v info >/dev/null || . /lib/dracut-lib.sh +# load dracut functions +command -v getarg >/dev/null || . /lib/dracut-lib.sh -info "Getting configuration from OPENSLX-Server..." +# read SLX_SERVER and SLX_BASE from the kernel command line +SLX_SERVER=$(getarg slxsrv) +SLX_BASE=$(getarg slxbase) +SLX_CONFIG_DIR="/opt/openslx" +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 +fi +if [ -z "$SLX_BASE" ]; then + warn "No 'slxbase' parameter found in the kernel command line!" + warn "Skipping OpenSLX configuration..." + exit 1 +fi +info "Getting configuration from OPENSLX-Server..." WGET="$(busybox which wget)" if [ -z $WGET ]; then # do nothing warn "'wget' not found. Skipping openslx configuration..." exit 1 fi -mkdir -p /opt/openslx -$WGET http://10.4.9.51/openslx/config -O /opt/openslx/config + +# 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}" |