From 3947d475419f28f5c96d3db96eea26d8e1e92314 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 9 Sep 2012 16:28:39 +0200 Subject: Make $configdirs reusable for non-postfix lookups. --- postfix/postfix.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/postfix/postfix.sh b/postfix/postfix.sh index 0132451..6d19240 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -39,7 +39,7 @@ cacert_lmtp= cacert_default="/etc/ssl/certs/ca-certificates.crt" realmsdir='/etc/local-REDPILL' -configdirs='/etc/local/postfix /etc/local-ORG/postfix /etc/local-REDPILL/postfix /etc/local-COMMON/postfix' +configdirs='/etc/local /etc/local-ORG /etc/local-REDPILL /etc/local-COMMON' confdir='/etc/postfix' postconf=/usr/sbin/postconf sp='[[:space:]]' @@ -155,10 +155,11 @@ catallfilesfromotherrealms() { catfirstfile() { set -e file="$1" + context="${2:-postfix}" configdir='' for dir in $configdirs; do - if [ -d "$dir" ] && [ -f "$dir/$file" ]; then - configdir="$dir" + if [ -d "$dir/$context" ] && [ -f "$dir/$context/$file" ]; then + configdir="$dir/$context" break fi done -- cgit v1.2.3