ia64/xen-unstable

view tools/check/check_udev @ 13032:afc6b5a60866

[TOOLS] Fix check-script compatibility with non-bash shells.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Dec 14 16:00:31 2006 +0000 (2006-12-14)
parents 85f331c7af76
children 2732b6ab217b
line source
1 #!/bin/sh
2 # CHECK-INSTALL
4 RC=0
6 case ${OS} in
7 OpenBSD|NetBSD|FreeBSD)
8 TOOL="vnconfig"
9 which ${TOOL} 1>/dev/null 2>&1 || RC=1
10 ;;
11 Linux)
12 TOOL="udevinfo"
13 test -x "$(which ${TOOL})" && \
14 UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
15 if test -n "${UDEV_VERSION}" -a ${UDEV_VERSION} -ge 059; then
16 RC=0
17 else
18 TOOL="hotplug"
19 which ${TOOL} 1>/dev/null 2>&1 || RC=1
20 fi
21 ;;
22 *)
23 TOOL=""
24 echo "Unknown OS" && RC=1
25 ;;
26 esac
28 if test ${RC} -ne 0; then
29 echo
30 echo ' *** Check for ${TOOL} FAILED'
31 fi
33 exit ${RC}