tripleo-image-elements/elements/openvswitch/install.d/74-openvswitch

23 lines
634 B
Bash
Executable File

#!/bin/bash
set -eux
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
os-svc-enable -n openvswitch-switch
fi
if [ "$DIB_INIT_SYSTEM" == "upstart" ] ; then
echo "start on starting cloud-init-nonet" >> /etc/init/openvswitch-switch.override
if [ ! -f /etc/init/openvswitch-switch.conf ] ; then
cat << 'EOF' > /etc/init/openvswitch-switch.conf
# openvswitch-switch
# the purpose of this job is
# * start openvwitch-switch in upstart rather than SysV startup
pre-start script
export RUNLEVEL=2
/etc/init.d/openvswitch-switch start
end script
post-stop exec /etc/init.d/openvswitch-switch stop
EOF
fi
fi