* sanitize migrate_aliases.sh
authorWilfried Göesgens <willi@citadel.org>
Wed, 20 Feb 2008 19:40:54 +0000 (19:40 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 20 Feb 2008 19:40:54 +0000 (19:40 +0000)
* use migrate_aliases.sh the intended way in the postinst script.

citadel/debian/citadel-server.postinst
citadel/migrate_aliases.sh

index d91229168743e97ffece16bcf4499a188faa8e16..367caf766327d8c7b91565a280e77c3f779a2b9e 100644 (file)
@@ -54,7 +54,7 @@ set >/tmp/citsetup
                 cat $WELCOMEHTML; 
                 printf "\r\n\r\n--$SEPERATOR--\r\n\r\n") | \
                     /usr/sbin/citmail -bm -r "$FROM" "$TO"
-           /usr/lib/citadel-server/migrate_aliases.sh
+           /usr/lib/citadel-server/migrate_aliases.sh /etc/citadel/mail.aliases
         fi
 
         if test -S /var/run/citadel/citadel.socket; then 
index 9408135f25425c36ec680ff27181c32caa396925..a2360e85ff8c1bc126ccdcade8401adb3b7ca6fb 100755 (executable)
@@ -1,4 +1,8 @@
 #!/bin/bash
+if test -z "$1"; then
+    echo "Usage: $0 mail.aliases"
+    exit
+fi
 
 CITALIAS=$1
 if test -f /etc/aliases; then
@@ -15,7 +19,7 @@ if test -f /etc/aliases; then
     for ((i=1; i <= $NLINES; i++)); do 
        ALIAS=`head -n $i /tmp/aliases |tail -n 1`
        ORG=`echo $ALIAS|sed "s;,.*;;"`
-       if grep $ORG $CITALIAS; then
+       if grep "$ORG" "$CITALIAS"; then
            echo "Ignoring Alias $ORG as its alreday there"
        else
            echo "$ALIAS" >>$CITALIAS