X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-lib.in;h=48d0c36c87513cb7018d7d9ac3b079c9dfc7b62e;hb=0ef165ecb57943e17a8ee8270df68ffb8d032e29;hp=1684ddcdd6205a64fa70a5a0f273f0bcf0cac0bc;hpb=a34779bcbe9a4fd568bdcd414ee0416c208dbf22;p=sliver-openvswitch.git diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 1684ddcdd..48d0c36c8 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -49,6 +49,18 @@ ovs_ctl () { # pipe). So, do not log the o/p to ovs-ctl.log. "${datadir}/scripts/ovs-ctl" "$@" ;; + "status") + # In case of the command 'status', we should return the exit status + # of ovs-ctl. It is also useful to document the o/p in ovs-ctl.log. + display=`"${datadir}/scripts/ovs-ctl" "$@" 2>&1` + rc=$? + if test -w "${logdir}/ovs-ctl.log"; then + echo "${display}" | tee -a "${logdir}/ovs-ctl.log" + else + echo "${display}" + fi + return ${rc} + ;; *) echo "`date -u`:$@" >> "${logdir}/ovs-ctl.log" "${datadir}/scripts/ovs-ctl" "$@" 2>&1 | tee -a "${logdir}/ovs-ctl.log"