[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [rhelv5-list] Regular Expressions on RHEL 5



It's just a script to download email address to populate my relay recipient map for postfix.  It's not pretty and I'm definitely not a shell scripter but it seems to work. 
  

#!/bin/bash
#-----------------------------------------------------------------
#
# Script for download and updating Relay Recipients...

# Working directory
WDIR=/etc/postfix
# URL of file to be downloaded
URL=https://myservername/mail/
# Filename of file to be worked with
FNAME=relay_recipients
WGETOPTS=" -N --no-check-certificate"
set -o errexit

cd $WDIR
wget $WGETOPTS ${URL}/${FNAME} 2>&1 >/dev/null | egrep -q '[Nn]ot (retrieving|Found)' && exit
postmap $FNAME
logger -p mail.info -t UPDATED.POSTFIX Relay Recipients Map
exit 0



Ian


----- "John Summerfield" <debian herakles homelinux org> wrote:
> Ian Lists wrote:
> > I have a strange situation where a script that works on RHEL 4 and
> Fedora 8 doesn't work with RHEL5.  The piece of the script that is
> failing is very simple, it's just a wget with grep.
> > wget -N --no-check-certificate https://myserver.net/file.txt  2>&1
> >/dev/null  | egrep -q '[Nn]ot\ [retrieving|Found]' && exit
> > 
> > It doesn't seem to care about matching the grep results on RHEL5, it
> just always exits.  The script should just continue on if it doesn't
> get a hit on the grep statement. Anyone have any suggestions?
> 
> Ian (and nobody else), please explain what you think your redirection
> is 
> doing.
> 
> 
> -- 
> 
> Cheers
> John
> 
> -- spambait
> 1aaaaaaa coco merseine nu  Z1aaaaaaa coco merseine nu
> -- Advice
> http://webfoot.com/advice/email.top.php
> http://www.catb.org/~esr/faqs/smart-questions.html
> http://support.microsoft.com/kb/555375
> 
> You cannot reply off-list:-)
> 
> _______________________________________________
> rhelv5-list mailing list
> rhelv5-list redhat com
> https://www.redhat.com/mailman/listinfo/rhelv5-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]