From 82489b594b60150641a856a0aa9b76c740af7d61 Mon Sep 17 00:00:00 2001 From: Giuseppe Lettieri Date: Tue, 11 Sep 2012 09:56:29 +0200 Subject: [PATCH] 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. --- planetlab/scripts/sliver-ovs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 -- 2.47.0