„setup_tunnel.sh“ ändern
This commit is contained in:
parent
ae130004ff
commit
62eadd676f
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
#set -x
|
||||||
OS_KEYPAIR_NAME=ovh_$(hostname -s)
|
OS_KEYPAIR_NAME=ovh_$(hostname -s)
|
||||||
OS_MACHINE_NAME=gbv
|
OS_MACHINE_NAME=gbv
|
||||||
SERVER_RUNNING=false
|
SERVER_RUNNING=false
|
||||||
@ -25,11 +25,11 @@ source openrc.sh
|
|||||||
#
|
#
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
#
|
#
|
||||||
if ! command -v ipcalc-ng &>/dev/null
|
#if ! command -v ipcalc-ng &>/dev/null
|
||||||
then
|
#then
|
||||||
echo >&2 "ipcalc-ng is required. Exiting."
|
#echo >&2 "ipcalc-ng is required. Exiting."
|
||||||
exit 1
|
#exit 1
|
||||||
fi
|
#fi
|
||||||
if ! command -v openstack &>/dev/null
|
if ! command -v openstack &>/dev/null
|
||||||
then
|
then
|
||||||
echo >&2 "openstack is required. Exiting."
|
echo >&2 "openstack is required. Exiting."
|
||||||
@ -69,7 +69,7 @@ openstack keypair list|grep -q $OS_KEYPAIR_NAME
|
|||||||
RESULT=$?
|
RESULT=$?
|
||||||
if [ $RESULT -eq 1 ]; then
|
if [ $RESULT -eq 1 ]; then
|
||||||
echo "Uploading SSH key to OpenStack..."
|
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
|
fi
|
||||||
#
|
#
|
||||||
# Get flavor and image
|
# 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=}"
|
SERVER_IPS="${SERVER_IPS##Ext-Net=}"
|
||||||
read -a SERVER_IPS <<< $SERVER_IPS
|
read -a SERVER_IPS <<< $SERVER_IPS
|
||||||
SERVER_IPS[0]="${SERVER_IPS[0]%%,}"
|
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=$?
|
IS_IPV4=$?
|
||||||
if [ $IS_IPV4 -eq 0 ]
|
if [ $IS_IPV4 -eq 0 ]
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user