Created
June 25, 2014 02:22
-
-
Save brandonlogan/9f9575d57c1d789a8da7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [ ! "$(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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment