From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lu4nx Newsgroups: gmane.emacs.bugs 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 Message-ID: <1449210313-10200-2-git-send-email-lx@shellcodes.org> References: <1449210313-10200-1-git-send-email-lx@shellcodes.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1449215970 16236 80.91.229.3 (4 Dec 2015 07:59:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2015 07:59:30 +0000 (UTC) Cc: lu4nx To: 22091@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 04 08:59:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a4lGq-000861-Gf for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Dec 2015 08:59:12 +0100 Original-Received: from localhost ([::1]:39242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4lGp-0005MP-MD for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Dec 2015 02:59:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4lGm-0005KQ-DT for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 02:59:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4lGg-0003fp-Mb for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 02:59:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4lGg-0003et-He for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 02:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a4lGg-0003lP-63 for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 02:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: lu4nx Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Dec 2015 07:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22091 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144921591814429 (code B ref -1); Fri, 04 Dec 2015 07:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Dec 2015 07:58:38 +0000 Original-Received: from localhost ([127.0.0.1]:38172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a4lFz-0003kL-9q for submit@debbugs.gnu.org; Fri, 04 Dec 2015 02:58:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46968) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a4k1F-0001kn-Ur for submit@debbugs.gnu.org; Fri, 04 Dec 2015 01:39:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4k1C-0003tE-KA for submit@debbugs.gnu.org; Fri, 04 Dec 2015 01:39:01 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4k1C-0003tA-Hc for submit@debbugs.gnu.org; Fri, 04 Dec 2015 01:38:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4k1B-0003D0-Hd for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 01:38:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4k18-0003r0-AJ for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 01:38:57 -0500 Original-Received: from smtpbg298.qq.com ([184.105.67.102]:36148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4k18-0003pK-3G for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 01:38:54 -0500 X-QQ-mid: Xesmtp20t1449211127t850t0785 Original-Received: from lx-pc (unknown [182.138.102.86]) by esmtp4.qq.com (ESMTP) with id ; Fri, 04 Dec 2015 14:38:47 +0800 (CST) X-QQ-SSF: B1000000000000F0FF103F00000000Z X-QQ-FEAT: cbPjiZhc9zlnh/SMXp5vZvkjfO49tN56ZRmj68yiV3xtb7Rj1gXh2m6zJa0Ms Il94nxnG3NNZZJ51lUP13l7Q90T1nzcd3jtB1xnw7Q0OlT/pBwlTPuKlVcJL8fM1QN4obGL RMuO/8Zlb2ha1UvHsLlRsdEc3Xcsal7YsMI6bVh/WlVzUfcslMIGdSYJx3a9Tjmw1SbtTyW 5zZodLBc8gqD/kkMGaVvs8OwFVWb21NyTRJSatfLSO2Frv5pas4Ml X-QQ-GoodBg: 0 X-Mailer: git-send-email 2.5.0 In-Reply-To: <1449210313-10200-1-git-send-email-lx@shellcodes.org> X-QQ-SENDSIZE: 520 X-QQ-FName: 90FA0A7F27B247149DA50A89D6F0FBB2 X-QQ-LocalIP: 10.130.87.224 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Fri, 04 Dec 2015 02:58:18 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109573 Archived-At: 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