From 0c6879b85f4ba53281318b1c7919482a014caa47 Mon Sep 17 00:00:00 2001 From: rtmdk Date: Fri, 3 Nov 2017 14:33:36 +0800 Subject: [PATCH] fix shell error about tools/init-vpn Change-Id: Ie865b7175b46f939b629d5378d98d0aeba963df2 Closes-Bug: #1729778 --- tools/init-vpn | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/init-vpn b/tools/init-vpn index 08c000fb73..4a7271dbb7 100755 --- a/tools/init-vpn +++ b/tools/init-vpn @@ -19,8 +19,7 @@ function setup_site(){ function get_external_ip(){ local router_id=`neutron router-show $1 | awk '/ id /{print $4}'` - echo `neutron port-list -c fixed_ips -c device_id -c device_owner|grep router_gateway | awk -'/'.$router_id.'/{print $5}' | sed 's/["}]//g'` + echo `neutron router-list | grep '$router_id' | awk -F '"' '{print $16}'` } function clean_site(){ @@ -42,11 +41,11 @@ function setup(){ WEST_IP=$(get_external_ip router_west) setup_site east $EAST_SUBNET EAST_IP=$(get_external_ip router_east) - neutron ipsec-site-connection-create --name conn_east --vpnservice-id vpn_east --ikepolicy-id -ikepolicy1 --ipsecpolicy-id ipsecpolicy1 --peer-address $WEST_IP --peer-id $WEST_IP --peer-cidr + neutron ipsec-site-connection-create --name conn_east --vpnservice-id vpn_east --ikepolicy-id \ +ikepolicy1 --ipsecpolicy-id ipsecpolicy1 --peer-address $WEST_IP --peer-id $WEST_IP --peer-cidr \ $WEST_SUBNET --psk secret - neutron ipsec-site-connection-create --name conn_west --vpnservice-id vpn_west --ikepolicy-id -ikepolicy1 --ipsecpolicy-id ipsecpolicy1 --peer-address $EAST_IP --peer-id $EAST_IP --peer-cidr + neutron ipsec-site-connection-create --name conn_west --vpnservice-id vpn_west --ikepolicy-id \ +ikepolicy1 --ipsecpolicy-id ipsecpolicy1 --peer-address $EAST_IP --peer-id $EAST_IP --peer-cidr \ $EAST_SUBNET --psk secret }