summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2006-10-30 12:34:31 +0000
committerJonas Smedegaard <dr@jones.dk>2006-10-30 12:34:31 +0000
commit2334e6d4adda53e725b669d17e15d55a5f4c806b (patch)
treedbb17ff194dd4c03ecedd94476b86751d2bd24a0
parentfe4f87c93c7298770b56778f840e3f9f3eab3a34 (diff)
merge localmaildomainprepare with localmaildomainupdate to fail all if the first fails (and spped is also no longer an issue for separation). Extend copyright years. Do integer comparison in test (not character one).
-rwxr-xr-xlocalmaildomainprepare31
-rwxr-xr-xlocalmaildomainupdate10
2 files changed, 7 insertions, 34 deletions
diff --git a/localmaildomainprepare b/localmaildomainprepare
deleted file mode 100755
index 2805f6a..0000000
--- a/localmaildomainprepare
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# /usr/local/sbin/localmkpostfixvirtual
-# Copyright 2004 Jonas Smedegaard <dr@jones.dk>
-#
-# $Id: localmaildomainprepare,v 1.2 2006-05-05 10:31:13 jonas Exp $
-#
-# Prepare mailuser updates from system user database
-#
-# (wrapper script for localmkpostfixvirtual)
-#
-
-set -e
-
-if [ $# -ge 1 ]; then
- maildomain="$1"
- virtualfile="virtual-$1"
- shift
-else
- maildomain=""
- virtualfile="virtual"
-fi
-
-(
- cd /etc/postfix
- localmkpostfixvirtual $maildomain > $virtualfile.new
- if [ -f /etc/postfix/$virtualfile.addon ]; then
- cat /etc/postfix/$virtualfile.addon >> $virtualfile.new
- fi
- diff $@ $virtualfile $virtualfile.new
-)
diff --git a/localmaildomainupdate b/localmaildomainupdate
index d46aaa1..dbe7bff 100755
--- a/localmaildomainupdate
+++ b/localmaildomainupdate
@@ -1,9 +1,9 @@
#!/bin/sh
#
# /usr/local/sbin/localmaildomainupdate
-# Copyright 2004 Jonas Smedegaard <dr@jones.dk>
+# Copyright 2004-2006 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localmaildomainupdate,v 1.3 2006-05-05 10:31:13 jonas Exp $
+# $Id: localmaildomainupdate,v 1.4 2006-10-30 12:34:31 jonas Exp $
#
# Update an (already prepared!) mailuser file
#
@@ -23,7 +23,11 @@ fi
(
cd /etc/postfix
- diff $@ $virtualfile $virtualfile.new || if [ $? = 1 ]; then /bin/true; fi
+ localmkpostfixvirtual $maildomain > $virtualfile.new
+ if [ -f /etc/postfix/$virtualfile.addon ]; then
+ cat /etc/postfix/$virtualfile.addon >> $virtualfile.new
+ fi
+ diff $@ $virtualfile $virtualfile.new || if [ $? -eq 1 ]; then /bin/true; fi
echo -n "Above is the intended changes. OK to update (y/N)? "
read do_update
case $do_update in