diff options
author | Jonas Smedegaard <dr@jones.dk> | 2020-10-10 22:28:04 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2020-10-10 22:28:40 +0200 |
commit | ee37f6d9ab6eaf4108b9f0a31850262878186ce3 (patch) | |
tree | 7d96875e0ff220ad8b4334b41e274601240e2f48 | |
parent | 6fd0fbfaf8c5d7e34080b9c3f25c1dc0df564696 (diff) |
generalize variable $thisrealm, and improve uppercasing
-rwxr-xr-x | postfix/postfix.sh | 4 |
1 files changed, 1 insertions, 3 deletions
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 |