From: Giuseppe Lettieri Date: Tue, 11 Sep 2012 07:56:29 +0000 (+0200) Subject: add set-remote-endpoint action to sliver-ovs X-Git-Tag: sliver-openvswitch-1.8.90-0~21 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=82489b594b60150641a856a0aa9b76c740af7d61;hp=9ceb2057ac7c99c87eb3ba0f3a2a6e01ef5abe62;p=sliver-openvswitch.git add set-remote-endpoint action to sliver-ovs Now all makefile targets call a sliver-ovs action. This is required to centralize checks (is_{switch,db}_running and possibly more to come) and to make all sliver-openvwitch configuration variables (DB_SOCK and the like) available to all actions. --- diff --git a/planetlab/scripts/sliver-ovs b/planetlab/scripts/sliver-ovs index 5b888bd18..49d84cd3a 100755 --- a/planetlab/scripts/sliver-ovs +++ b/planetlab/scripts/sliver-ovs @@ -188,11 +188,11 @@ EOF function create_port () { - [[ -z "$@" ]] || error "$COMMAND create-port " + [[ -z "$@" ]] && error "$COMMAND create-port " bridge=$1; shift - [[ -z "$@" ]] || error "$COMMAND create-port " + [[ -z "$@" ]] && error "$COMMAND create-port " port=$1; shift - [[ -n "$@" ]] || error "$COMMAND create-port " + [[ -n "$@" ]] && error "$COMMAND create-port " # ensure ovs-vswitchd is running is_switch_running || { echo "ovs-vswitchd not running" >&2 ; exit 1 ; } @@ -207,13 +207,13 @@ function create_port () { function set_remote_endpoint () { - [[ -z "$@" ]] || error "$COMMAND set-remote-endpoint " + [[ -z "$@" ]] && error "$COMMAND set-remote-endpoint " port=$1; shift - [[ -z "$@" ]] || error "$COMMAND set-remote-endpoint " + [[ -z "$@" ]] && error "$COMMAND set-remote-endpoint " remote_ip=$1; shift - [[ -z "$@" ]] || error "$COMMAND set-remote-endpoint " + [[ -z "$@" ]] && error "$COMMAND set-remote-endpoint " remote_port=$1; shift - [[ -n "$@" ]] || error "$COMMAND set-remote-endpoint " + [[ -n "$@" ]] && error "$COMMAND set-remote-endpoint " # ensure ovs-vswitchd is running is_switch_running || { echo "ovs-vswitchd not running" >&2 ; exit 1 ; } @@ -270,7 +270,7 @@ function del_port () { SUPPORTED_SUBCOMMANDS="start stop status start_db stop_db start_switch stop_switch create_bridge create_port del_bridge del_port -set-remote-endpoint" +set_remote_endpoint" function main () { message="Usage: $COMMAND ... @@ -280,7 +280,7 @@ $SUPPORTED_SUBCOMMANDS" subcommand=$1; shift # support dashes instead of underscores - subcommand=$(echo $subcommand | sed -e s,-,_,) + subcommand=$(echo $subcommand | sed -e s,-,_,g) found="" for supported in $SUPPORTED_SUBCOMMANDS; do [ "$subcommand" = "$supported" ] && found=yes; done