From ee37f6d9ab6eaf4108b9f0a31850262878186ce3 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 10 Oct 2020 22:28:04 +0200 Subject: generalize variable $thisrealm, and improve uppercasing --- postfix/postfix.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'postfix') diff --git a/postfix/postfix.sh b/postfix/postfix.sh index 5dc4606..75ca1a6 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -36,6 +36,7 @@ TLS_CERT=${TLS_CERT:-/etc/ssl/certs/postfix.pem} TLS_KEY=${TLS_KEY:-/etc/ssl/private/postfix.pem} realmsdir="/etc/local-$REDPILL" +thisrealm="$(cat "/etc/local-$REALM/realm" || dnsdomainname | tr '[:lower:]' '[:upper:]')" confdir="/etc/postfix" if ! [ -d "$realmsdir" ]; then warn "Realms directory \"$realmsdir\" does not exist." @@ -106,8 +107,6 @@ catfilefromownrealm() { file="$1" [ -d "$realmsdir" ] || exit 0 - thisrealm="$(cat "/etc/local-$REALM/realm" || dnsdomainname | tr '[a-z]' '[A-Z]')" - cat "$realmsdir/$thisrealm/$file" } @@ -118,7 +117,6 @@ catallfilesfromotherrealms() { [ -f "$realmsdir/realms" ] || exit 0 realms="$(cat "$realmsdir/realms" | sed 's/#.*//')" - thisrealm="$(cat "/etc/local-$REALM/realm" || dnsdomainname | tr '[a-z]' '[A-Z]')" for realm in $realms; do if [ "$thisrealm" != "$realm" ]; then -- cgit v1.2.3