bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22091: [PATCH 2/2] * lisp/net/net-utils.el: (ifconfig) function supp


From: lu4nx
Subject: bug#22091: [PATCH 2/2] * lisp/net/net-utils.el: (ifconfig) function support `ip` command.
Date: Fri, 4 Dec 2015 14:25:13 +0800

In some Linux distribution default not found `ifconfig` command, such as 
CentOS7.

- `ifconfig-program` and `ifconfig-program-options` add support `ip` command.
---
 lisp/net/net-utils.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index c6d40b6..74e832a 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -87,7 +87,9 @@ These options can be used to limit how many ICMP packets are 
emitted."
 (defcustom ifconfig-program
   (if (eq system-type 'windows-nt)
       "ipconfig"
-    "ifconfig")
+    (if (whereis-command "ifconfig")
+        "ifconfig"
+      "ip"))
   "Program to print network configuration information."
   :group 'net-utils
   :type  'string)
@@ -97,8 +99,10 @@ These options can be used to limit how many ICMP packets are 
emitted."
 
 (defcustom ifconfig-program-options
   (list
-   (if (eq system-type 'windows-nt)
-       "/all" "-a"))
+   (cond ((eq system-type 'windows-nt) "/all")
+         ((and (whereis-command "ip")
+               (not (whereis-command "ifconfig"))) "addr")
+         (t "-a")))
   "Options for the ifconfig program."
   :group 'net-utils
   :type  '(repeat string))
-- 
2.5.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]