From 62eadd676f96627c9a484747cdd9f1930788a2f2 Mon Sep 17 00:00:00 2001 From: iwonder Date: Mon, 1 Mar 2021 21:37:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Esetup=5Ftunnel.sh=E2=80=9C=20=C3=A4nde?= =?UTF-8?q?rn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_tunnel.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/setup_tunnel.sh b/setup_tunnel.sh index cec6d56..35a6f96 100644 --- a/setup_tunnel.sh +++ b/setup_tunnel.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e +#set -x OS_KEYPAIR_NAME=ovh_$(hostname -s) OS_MACHINE_NAME=gbv SERVER_RUNNING=false @@ -25,11 +25,11 @@ source openrc.sh # # Prerequisites # -if ! command -v ipcalc-ng &>/dev/null -then -echo >&2 "ipcalc-ng is required. Exiting." -exit 1 -fi +#if ! command -v ipcalc-ng &>/dev/null +#then +#echo >&2 "ipcalc-ng is required. Exiting." +#exit 1 +#fi if ! command -v openstack &>/dev/null then echo >&2 "openstack is required. Exiting." @@ -69,7 +69,7 @@ openstack keypair list|grep -q $OS_KEYPAIR_NAME RESULT=$? if [ $RESULT -eq 1 ]; then echo "Uploading SSH key to OpenStack..." -nova keypair-add --pub_key ~/.ssh/id_ovh.pub $OS_KEYPAIR_NAME +nova keypair-add --pub-key ~/.ssh/id_ovh.pub $OS_KEYPAIR_NAME fi # # Get flavor and image @@ -94,7 +94,8 @@ SERVER_IPS="$(openstack server show gbv -f json|jq -r .addresses)" SERVER_IPS="${SERVER_IPS##Ext-Net=}" read -a SERVER_IPS <<< $SERVER_IPS SERVER_IPS[0]="${SERVER_IPS[0]%%,}" -ipcalc-ng -c4 ${SERVER_IPS[0]} &>/dev/null +#ipcalc-ng -c4 ${SERVER_IPS[0]} &>/dev/null +grep -q '\.' <<< ${SERVER_IPS[0]} IS_IPV4=$? if [ $IS_IPV4 -eq 0 ] then