Skip to content

Instantly share code, notes, and snippets.

@brandonlogan
Created June 25, 2014 18:57
Show Gist options
  • Save brandonlogan/741fb98620466eec79f4 to your computer and use it in GitHub Desktop.
Save brandonlogan/741fb98620466eec79f4 to your computer and use it in GitHub Desktop.
#!/bin/bash
match1='service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default'
insert1='service_provider=LOADBALANCERv2:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriverv2:default'
match2='service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPlugin'
insert2='service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPluginv2'
file='/etc/neutron/neutron.conf'
if [ `ps aux | grep neutron-server | wc -l` -gt 1 ]; then
kill -9 `ps aux | grep '[n]eutron-server' -m1 | awk '{print $2}'`
fi
if [ ! "$(grep "$insert1" $file)" ]; then
sed -i "s/$match1/$match1\n$insert1/" $file
fi
if [ ! "$(grep "$insert2" $file)" ]; then
sed -i "s/$match2/$insert2/" $file
fi
sudo PIP_DOWNLOAD_CACHE=/var/cache/pip HTTP_PROXY= HTTPS_PROXY= NO_PROXY= /usr/local/bin/pip install --build=/tmp/pip-build.bE71P -e /opt/stack/neutron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment