Hi,

On Thu, Feb 25, 2010 at 01:05:18PM +0200, Marian Marinov wrote:
> On Thursday 25 February 2010 12:44:17 Lars Marowsky-Bree wrote:
> > On 2010-02-25T09:18:51, Florian Haas <[email protected]> wrote:
> > > > 1. the whitespaces after the HOSTNAME should remain since this is
> > > > how are the unames exported to the RA
> > >
> > > Seriously? Then it's not your business to fix that, those environment
> > > variables must be set correctly. Andrew, can you confirm?
> > 
> > The environment variables _are_ set correctly. Since more than one node
> > could be promoted/demoted/started/stopped, they're effectively
> > white-space separated lists, so the trailing whitespace shouldn't
> > actually hurt.
> 
> Lars, sorry but it seams my shell scripting skills are not good enough to 
> solve this one... 
> 
> How would I match two hostnames:
> 
> host_a='shrek'
> host_b='shrek '
> 
> I don't know how to do that without RE in shell. I'll gladly change my stupid 
> solution.

You can try:

is_hostname_in_list() {
for h in $VAR; do
        [ "$h" = "$HOSTNAME" ] && return 0
done
return 1
}

Thanks,

Dejan

> -- 
> Best regards,
> Marian Marinov



> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to