4 # Provides: openvswitch-vtep
5 # Required-Start: $network $named $remote_fs $syslog
6 # Required-Stop: $remote_fs
7 # Default-Start: 2 3 4 5
9 # Short-Description: Open vSwitch VTEP emulator
10 # Description: Initializes the Open vSwitch VTEP emulator
14 # Include defaults if available
15 default=/etc/default/openvswitch-vtep
16 if [ -f $default ] ; then
21 if [ "$ENABLE_OVS_VTEP" = "false" ]; then
25 update-rc.d -f openvswitch-switch remove >/dev/null 2>&1
26 /etc/init.d/openvswitch-switch stop
28 mkdir -p "/var/run/openvswitch"
30 if [ ! -e "/etc/openvswitch/conf.db" ]; then
31 ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
34 if [ ! -e "/etc/openvswitch/vtep.db" ]; then
35 ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema
38 if [ ! -e "/etc/openvswitch/ovsclient-cert.pem" ]; then
39 export RANDFILE="/root/.rnd"
40 cd /etc/openvswitch && ovs-pki req ovsclient && ovs-pki self-sign ovsclient
43 ovsdb-server --pidfile --detach --log-file --remote \
44 punix:/var/run/openvswitch/db.sock \
45 --remote=db:hardware_vtep,Global,managers \
46 --private-key=/etc/openvswitch/ovsclient-privkey.pem \
47 --certificate=/etc/openvswitch/ovsclient-cert.pem \
48 --bootstrap-ca-cert=/etc/openvswitch/vswitchd.cacert \
49 /etc/openvswitch/conf.db /etc/openvswitch/vtep.db
53 ovs-vswitchd --pidfile --detach --log-file \
54 unix:/var/run/openvswitch/db.sock
58 /etc/init.d/openvswitch-switch stop
73 echo "Usage: $0 {start|stop|restart|force-reload}" >&2