diff mbox series

[ovs-dev,2/3] ovs-save: compatible with busybox ip command

Message ID 20181130073004.18051-3-zhouyousong@yunionyun.com
State Accepted
Headers show
Series build: patches from OpenWrt | expand

Commit Message

Yousong Zhou Nov. 30, 2018, 7:30 a.m. UTC
From: Yousong Zhou <yszhou4tech@gmail.com>

Busybox ip command will have exit code 1 for `ip -V` or `ip help` etc.,
use `ip link show` to cover both iproute2 and busybox ip command

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
 utilities/ovs-save | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff Dec. 3, 2018, 9:15 p.m. UTC | #1
On Fri, Nov 30, 2018 at 07:30:03AM +0000, Yousong Zhou wrote:
> From: Yousong Zhou <yszhou4tech@gmail.com>
> 
> Busybox ip command will have exit code 1 for `ip -V` or `ip help` etc.,
> use `ip link show` to cover both iproute2 and busybox ip command
> 
> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

Thanks, I applied patches 2 and 3.  I'll wait for a revision of patch 1.
diff mbox series

Patch

diff --git a/utilities/ovs-save b/utilities/ovs-save
index bcb8e9b8a..1ba36e9de 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -38,7 +38,7 @@  EOF
 }
 
 save_interfaces () {
-    if (ip -V) > /dev/null 2>&1; then :; else
+    if (ip link show) > /dev/null 2>&1; then :; else
         echo "$0: ip not found in $PATH" >&2
         exit 1
     fi