Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 1 | # Neutron VPN plugin |
| 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 5 | VPN_XTRACE=$(set +o | grep xtrace) |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 6 | set +o xtrace |
| 7 | |
| 8 | |
Nachi Ueno | 584750f | 2013-07-15 18:22:21 -0700 | [diff] [blame] | 9 | AGENT_VPN_BINARY="$NEUTRON_BIN_DIR/neutron-vpn-agent" |
Kyle Mestery | 20b839f | 2014-12-08 06:17:27 +0000 | [diff] [blame] | 10 | VPN_PLUGIN=${VPN_PLUGIN:-"neutron_vpnaas.services.vpn.plugin.VPNDriverPlugin"} |
Nachi Ueno | 1e3d318 | 2013-08-15 18:15:31 -0700 | [diff] [blame] | 11 | IPSEC_PACKAGE=${IPSEC_PACKAGE:-"openswan"} |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 12 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 13 | function neutron_vpn_install_agent_packages { |
Nachi Ueno | 1e3d318 | 2013-08-15 18:15:31 -0700 | [diff] [blame] | 14 | install_package $IPSEC_PACKAGE |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 15 | } |
| 16 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 17 | function neutron_vpn_configure_common { |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame] | 18 | _neutron_service_plugin_class_add $VPN_PLUGIN |
Ihar Hrachyshka | 5893cc7 | 2014-12-22 11:49:42 +0100 | [diff] [blame^] | 19 | _neutron_deploy_rootwrap_filters $NEUTRON_VPNAAS_DIR |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 20 | } |
| 21 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 22 | function neutron_vpn_stop { |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 23 | local ipsec_data_dir=$DATA_DIR/neutron/ipsec |
| 24 | local pids |
| 25 | if [ -d $ipsec_data_dir ]; then |
| 26 | pids=$(find $ipsec_data_dir -name 'pluto.pid' -exec cat {} \;) |
| 27 | fi |
| 28 | if [ -n "$pids" ]; then |
| 29 | sudo kill $pids |
| 30 | fi |
| 31 | } |
| 32 | |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 33 | # Restore xtrace |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 34 | $VPN_XTRACE |