lkml.org 
[lkml]   [2005]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] aoe: add documentation for udev users
From
Date
Bodo Eggert <7eggert@gmx.de> writes:

> Ed L Cashin <ecashin@coraid.com> wrote:
>
>> +if test -z "$conf"; then
>> +        conf="`find /etc -type f -name udev.conf 2> /dev/null`"
>> +fi
>> +if test -z "$conf" || test ! -r $conf; then
>> +        echo "$me Error: could not find readable udev.conf in /etc" 1>&2
>> +        exit 1
>> +fi
>
> This will fail and print
> ---
> bash: test: etc/udev.conf: binary operator expected
> ---
> if there is more than one udev.conf.
>
> Fix: Always put quotes around variables.

Thanks. With the changes below, it still will complain if it finds
more than one udev.conf, but only if /etc/udev/udev.conf doesn't
exist.


Quote all shell variables, and use /etc/udev/udev.conf if available.

Signed-off-by: Ed L. Cashin <ecashin@coraid.com>

diff -uprN a/Documentation/aoe/udev-install.sh b/Documentation/aoe/udev-install.sh
--- a/Documentation/aoe/udev-install.sh 2005-01-20 09:14:58.000000000 -0500
+++ b/Documentation/aoe/udev-install.sh 2005-01-20 09:13:38.000000000 -0500
@@ -8,11 +8,15 @@ me="`basename $0`"
# (or environment can specify where to find udev.conf)
#
if test -z "$conf"; then
- conf="`find /etc -type f -name udev.conf 2> /dev/null`"
-fi
-if test -z "$conf" || test ! -r $conf; then
- echo "$me Error: could not find readable udev.conf in /etc" 1>&2
- exit 1
+ if test -r /etc/udev/udev.conf; then
+ conf=/etc/udev/udev.conf
+ else
+ conf="`find /etc -type f -name udev.conf 2> /dev/null`"
+ if test -z "$conf" || test ! -r "$conf"; then
+ echo "$me Error: no udev.conf found" 1>&2
+ exit 1
+ fi
+ fi
fi

# find the directory where udev rules are stored, often

--
Ed L Cashin <ecashin@coraid.com>
\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.234 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site