diff options
author | Jonas Smedegaard <dr@jones.dk> | 2007-07-12 18:37:08 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2007-07-12 18:37:08 +0000 |
commit | f609b7f62328c3d40a8820a9e8f1ac94d19feac6 (patch) | |
tree | c1981f3e0530be0d974173699297456da0868efb /postfix | |
parent | 276a40617c9cd591c27700a372b125f77d7b8a84 (diff) |
Rename paramdir -> configdir. Fix resetting configdir before use.
Diffstat (limited to 'postfix')
-rwxr-xr-x | postfix/postfix.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/postfix/postfix.sh b/postfix/postfix.sh index e77bae5..a0f663a 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -3,7 +3,7 @@ # /etc/local-COMMON/postfix/postfix.sh # Copyright 2002-2004 Jonas Smedegaard <dr@jones.dk> # -# $Id: postfix.sh,v 1.42 2007-07-12 14:30:23 jonas Exp $ +# $Id: postfix.sh,v 1.43 2007-07-12 18:37:08 jonas Exp $ # # Auto-tweak plain installed postfix Debian package # @@ -16,7 +16,7 @@ set -e -paramdirs='/etc/local/postfix /etc/local-ORG/postfix /etc/local-REDPILL/postfix /etc/local-COMMON/postfix' +configdirs='/etc/local/postfix /etc/local-ORG/postfix /etc/local-REDPILL/postfix /etc/local-COMMON/postfix' confdir='/etc/postfix' postconf=/usr/sbin/postconf sp='[[:space:]]' @@ -56,17 +56,18 @@ fi sasldir="$confdir/sasl" catfirstfile() { - for dir in $paramdirs; do + configdir='' + for dir in $configdirs; do if [ -d "$dir" ] && [ -f "$dir/$param" ]; then - paramdir="$dir" + configdir="$dir" break fi done - if [ -z "$paramdir" ]; then + if [ -z "$configdir" ]; then echo "ERROR: Parameter file for \"$param\" not found." exit 1 fi - cat "$paramdir/$param" + cat "$configdir/$param" } getlinesfromfile() { @@ -95,7 +96,6 @@ getlinesfromfile() { done replacements="$replacements;s/$oldparam/$newstring/" done - paramdir='' echo -n "$param = " catfirstfile "$param" | sed 's/#.*//' | tr '\n' ',' | sed -e 's/^[, ]*//;s/[, ]\+/,/g' -e 's/\^/ /g' -e "s/,\$//$replacements" } |