diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-10-18 15:26:08 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-10-18 15:26:08 +0100 |
commit | ee89b4ab594e3027c04052108ea8b494750fe26c (patch) | |
tree | 66eda110b9a9a4f557a2ccfb1cb1d260218c161b /tools/check/check_iproute | |
parent | 19c8d7a8fa0bb6c959135c537144fa2a4044d790 (diff) | |
download | xen-ee89b4ab594e3027c04052108ea8b494750fe26c.tar.gz xen-ee89b4ab594e3027c04052108ea8b494750fe26c.tar.bz2 xen-ee89b4ab594e3027c04052108ea8b494750fe26c.zip |
Fix 'chk' scripts for generic shell (non-bash) and *BSD.
From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/check/check_iproute')
-rwxr-xr-x | tools/check/check_iproute | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/tools/check/check_iproute b/tools/check/check_iproute index c990349a9b..35af9a4c4b 100755 --- a/tools/check/check_iproute +++ b/tools/check/check_iproute @@ -1,11 +1,26 @@ -#!/bin/bash +#!/bin/sh # CHECK-INSTALL -function error { - echo - echo ' *** Check for iproute (ip addr) FAILED' - exit 1 -} +RC=0 -ip addr list 1>/dev/null 2>&1 || error +case ${OS} in +OpenBSD|NetBSD|FreeBSD) + TOOL="ifconfig" + eval ${TOOL} -a 1>/dev/null 2>&1 || RC=1 + ;; +Linux) + TOOL="ip addr" + eval ${TOOL} list 1>/dev/null 2>&1 || RC=1 + ;; +*) + TOOL="" + echo "Unknown OS" && RC=1 + ;; +esac +if test ${RC} -ne 0; then + echo + echo " *** Check for iproute (${TOOL}) FAILED" +fi + +exit ${RC} |