]> git.proxmox.com Git - ovs.git/commitdiff
utilities: don't use a bashism to check that datapath exists
authorTimothy Redaelli <tredaelli@redhat.com>
Wed, 1 Aug 2018 15:48:21 +0000 (17:48 +0200)
committerBen Pfaff <blp@ovn.org>
Sat, 4 Aug 2018 00:07:25 +0000 (17:07 -0700)
[[ ]] syntax is not supported, at least, by dash that Debian, Ubuntu and other
linux distributions may use instead of bash.

This commit uses, instead, a POSIX way that is compatible with any POSIX
shell (bash, dash, busybox sh, etc).

CC: Martin Xu <martinxu9.ovs@gmail.com>
Fixes: 9763d17fbd05 ("utilities: check datapath exists before conntrack flush")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
utilities/ovs-lib.in

index f36bd0103e6edd7ad0124c86a07c73694b08432b..10c709792ae188ad5a82cfd56c5c0e1e093cfe71 100644 (file)
@@ -605,7 +605,7 @@ force_reload_kmod () {
     stop_ovsdb
     start_ovsdb || return 1
 
-    if [[ $(ovs-dpctl show) ]]; then
+    if [ -n "$(ovs-dpctl show)" ]; then
         action "Flush old conntrack entries" ovs-appctl dpctl/flush-conntrack
     fi
     stop_forwarding