freebsd-ports/net/openvswitch/files/ovsdb-server.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

40 lines
978 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ovsdb_server
# REQUIRE: LOGIN
. /etc/rc.subr
name="ovsdb_server"
rcvar=ovsdb_server_enable
command="%%PREFIX%%/sbin/ovsdb-server"
pidfile="%%PREFIX%%/var/run/ovsdb-server.pid"
start_precmd="ovsdb_server_precmd"
load_rc_config $name
: ${ovsdb_server_enable="NO"}
: ${ovsdb_server_sock="%%PREFIX%%/var/run/openvswitch/db.sock"}
: ${ovsdb_server_database="%%PREFIX%%/etc/openvswitch/conf.db"}
ovsdb_server_precmd() {
[ -e "`dirname $ovsdb_server_database`" ] || \
mkdir -p "`dirname $ovsdb_server_database`"
[ -e "$ovsdb_server_database" ] || \
%%PREFIX%%/bin/ovsdb-tool create "$ovsdb_server_database" \
%%PREFIX%%/share/openvswitch/vswitch.ovsschema
}
command_args="--detach --pidfile=$pidfile \
--remote=punix:$ovsdb_server_sock \
--remote=db:Open_vSwitch,managers \
--private-key=db:SSL,private_key \
--certificate=db:SSL,certificate \
--bootstrap-ca-cert=db:SSL,ca_cert \
$ovsdb_server_database"
run_rc_command "$1"