TT#28952 Change scripts to use 'small' GRML

In 'small' GRML utils nmap, curl, ifdata are missing so replace them
with another ones and install required packages for installcd in
one place.

Change-Id: I7269bb53b66805c792f5e91ff97a2fd2ebd14d1f
changes/38/20338/4
Mykola Malkov 7 years ago committed by Alexander Lutay
parent 036e84fbe6
commit d15f0387a3

@ -15,13 +15,10 @@ EXIT_CODE=1
GW="$(route -n | awk '/^0\.0\.0\.0/{print $2}')"
GWDEV="$(route -n | awk '/^0\.0\.0\.0/{print $NF}')"
NMAP="$(nmap -sP --host_timeout 4000 --max_rtt_timeout 4000ms "$GW" 2>/dev/null)"
if [ $? -eq 0 ]; then
if ! echo "$NMAP" | grep -q "0 hosts up" ; then
STATUS="Online (${GWDEV})"
EXIT_CODE=0
fi
if ping -c 3 "${GW}" >/dev/null ; then
STATUS="Online (${GWDEV})"
EXIT_CODE=0
fi
printf "%s\n" "$STATUS"

@ -37,13 +37,11 @@ if checkBootParam ngcppro ; then
if checkBootParam "sipwiserepo=" ; then
SIPWISE_REPO_HOST=$(getBootParam sipwiserepo)
fi
URL="${SIPWISE_REPO_TRANSPORT}://${SIPWISE_REPO_HOST}/sppro/"
accessible=$( curl -s -o /dev/null -w "%{http_code}" "${URL}" 2>/dev/null || true )
err_message="You are installing Pro/Carrier version but ${SIPWISE_REPO_TRANSPORT}://${SIPWISE_REPO_HOST}/sppro/ repository not accessible. Please contact support@sipwise.com"
while [[ "${accessible}" != 200 ]]; do
if dialog --yes-label Retry --no-label Exit --yesno "${err_message}" 0 0 ; then
accessible=$( curl -s -o /dev/null -w "%{http_code}" "${URL}" 2>/dev/null || true )
else
while ! wget -q -T 10 -O /dev/null "${URL}" ; do
if ! dialog --yes-label Retry --no-label Exit --yesno "${err_message}" 0 0 ; then
exit 1
fi
done

@ -0,0 +1,9 @@
#!/bin/bash
set -e
echo "Updating list of packages..."
apt-get update 1>/dev/null
echo "Installing required packages..."
apt-get install --assume-yes \
isomd5sum

@ -4,8 +4,6 @@ set -e
message="Do you want to check the install media?"
if dialog --yes-label Yes --no-label Skip --yesno "${message}" 0 0 ; then
sudo apt-get update 1>/dev/null || true
sudo apt-get install isomd5sum --assume-yes 1>/dev/null || true
if ! result="$( { checkisomd5 /dev/sr0 1>/dev/null; } 2>&1 )" ; then
err_message="Integrity check failed. Reason: ${result}. Abort installation or continue anyway?"
if dialog --yes-label Exit --no-label Continue --yesno "${err_message}" 0 0 ; then

@ -145,6 +145,7 @@ deploy() {
install_sipwise_keyring
"${scripts_dir}/network_configuration.sh"
"${scripts_dir}/check_installing_version.sh"
"${scripts_dir}/install_required_packages.sh"
"${scripts_dir}/verify_iso_image.sh"
prompt_for_target
check_for_existing_pvs

Loading…
Cancel
Save