Mailinglist Archive: opensuse-autoinstall (87 mails)

< Previous Next >
[opensuse-autoinstall] range-type in scripts is faulty
  • From: Frank Steiner <fsteiner-mail1@xxxxxxxxxxxxxx>
  • Date: Fri, 02 Feb 2007 11:47:15 +0100
  • Message-id: <45C316B3.8070303@xxxxxxxxxxxxxx>
Hi Uwe,

in AY for SLES10 I'm using a script like this:

<rule>
<custom3>
<script>
<![CDATA[
#!/bin/sh
ip=$(/sbin/ifconfig eth0 | sed -n "s/\(inet\ addr:\)\([0-9.]*\).*/\2/p" | cut -d'.' -f 4)
echo -n $ip
]]>
</script>
<match>171-204</match>
<match_type>range</match_type>
</custom3>
<result>
... (whatever)


My understanding is that a host with ip x.x.x.171 should match that rule.
However, y2log show the following:

AutoInstallRules.ycp:390 Bash return: if ( [ "$custom3" -gt "171" -a "$custom3" -lt "204" ] ) ; then exit 0; else exit 1; fi

I feel this is wrong and must be "-ge" and "-le" instead of "-gt" and "-lt"
because I expect a closed range, not an open one. I really do need a fix for
that, because we generate those rules from host config files automatically :-(

cu,
Frank


--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
--
To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-autoinstall+help@xxxxxxxxxxxx

< Previous Next >
This Thread
Follow Ups