- echo "$default: MODE must set to 'discovery', 'in-band', or 'out-of-band'" >&2
- echo "Run ovs-switch-setup (in the openvswitch-switch-config package) or edit /etc/default/openvswitch-switch to configure" >&2
- exit 1
- fi
- : ${PRIVKEY:=/etc/openvswitch-switch/of0-privkey.pem}
- : ${CERT:=/etc/openvswitch-switch/of0-cert.pem}
- : ${CACERT:=/etc/openvswitch-switch/cacert.pem}
- case $CONTROLLER in
- '')
- # Discovery mode.
- if test -e "$PRIVKEY"; then
- configure_ssl
- fi
- ;;
- tcp:*)
- ;;
- ssl:*)
- configure_ssl
- ;;
- *)
- echo "$default: CONTROLLER must be in the form 'ssl:IP[:PORT]' or 'tcp:IP[:PORT]' when not in discovery mode" >&2
- echo "Run ovs-switch-setup (in the openvswitch-switch-config package) or edit /etc/default/openvswitch-switch to configure" >&2
- exit 1
- esac
- case $DISCONNECTED_MODE in
- ''|switch|drop) ;;
- *) echo "$default: warning: DISCONNECTED_MODE is not 'switch' or 'drop'" >&2 ;;
- esac
-
- check_int_var RATE_LIMIT 100
- check_int_var INACTIVITY_PROBE 5
- check_int_var MAX_BACKOFF 1
-
- check_new_option --fail DISCONNECTED_MODE
- check_new_option --stp STP
- check_new_option --rate-limit RATE_LIMIT
- check_new_option --inactivity INACTIVITY_PROBE
- check_new_option --max-backoff MAX_BACKOFF
- case $DAEMON_OPTS in
- *--rate-limit*)
- echo "$default: --rate-limit may now be set with RATE_LIMIT" >&2
- esac
-
- echo -n "Loading openvswitch_mod: "
- if grep -q '^openvswitch_mod$' /proc/modules; then
- echo "already loaded, nothing to do."
- elif modprobe openvswitch_mod; then
- echo "success."
- else
- echo "ERROR."
- echo "openvswitch_mod has probably not been built for this kernel."
- if ! test -d /usr/share/doc/openvswitch-datapath-source; then
- echo "Install the openvswitch-datapath-source package, then read"
- echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
- else
- echo "For instructions, read"
- echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
- fi
- exit 1