Difference between revisions of "Exchange receipients.sh"

From Alpine Linux
Jump to: navigation, search
Line 1: Line 1:
#!/bin/sh
+
#!/bin/sh<br>
  
### The minimal lines virtual.txt must have to generate the db
+
### The minimal lines virtual.txt must have to generate the db<br>MINLINES="50"<br>### The url to the receipients file<br>URL=""<br>
MINLINES="50"
 
### The url to the receipients file
 
URL=""
 
  
wget "$URL" -qO /tmp/virtual.txt
+
wget "$URL" -qO /tmp/virtual.txt<br>
  
if [ -f /tmp/virtual.txt ]; then
+
if [ -f /tmp/virtual.txt ]; then<br> LINES=`cat /tmp/virtual.txt | wc -l`<br> if [ "$LINES" -gt "$MINLINES" ]; then<br> dos2unix /tmp/virtual.txt<br> sed '/^\#/d; /^$/d' /tmp/virtual.txt &gt; /etc/postfix/exchange_receipients<br> postmap /etc/postfix/exchange_receipients<br> fi<br>fi<br>
    LINES=`cat /tmp/virtual.txt | wc -l`
 
    if [ "$LINES" -gt "$MINLINES" ]; then
 
      dos2unix /tmp/virtual.txt
 
      sed '/^\#/d; /^$/d' /tmp/virtual.txt > /etc/postfix/exchange_receipients
 
      postmap /etc/postfix/exchange_receipients
 
    fi
 
fi
 

Revision as of 18:08, 18 February 2009

  1. !/bin/sh
      1. The minimal lines virtual.txt must have to generate the db
        MINLINES="50"
        ### The url to the receipients file
        URL=""

wget "$URL" -qO /tmp/virtual.txt

if [ -f /tmp/virtual.txt ]; then
LINES=`cat /tmp/virtual.txt | wc -l`
if [ "$LINES" -gt "$MINLINES" ]; then
dos2unix /tmp/virtual.txt
sed '/^\#/d; /^$/d' /tmp/virtual.txt > /etc/postfix/exchange_receipients
postmap /etc/postfix/exchange_receipients
fi
fi