diff options
author | Jonas Smedegaard <dr@jones.dk> | 2018-10-20 10:42:09 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2018-10-20 10:42:09 +0200 |
commit | f0e8aa8997900e33c7a8de9c8cfd34b996010c63 (patch) | |
tree | 9a7a9eaf5b917f7d886f8215f7e019e59489d7dc /dehydrated/cron.weekly/local-dehydrated | |
parent | 0c9fc9341cf98a45e1a79b38e6fe4c6e1e6cb76f (diff) |
Revert "Fix include mailname in mailhost cert if different (not skip renew mailhost cert if identical: Git commit d9dd0fc seemingly intended to handle empty mailname)."
This reverts commit 0c9fc9341cf98a45e1a79b38e6fe4c6e1e6cb76f.
Diffstat (limited to 'dehydrated/cron.weekly/local-dehydrated')
-rwxr-xr-x | dehydrated/cron.weekly/local-dehydrated | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/dehydrated/cron.weekly/local-dehydrated b/dehydrated/cron.weekly/local-dehydrated index 9e68459..43ab94d 100755 --- a/dehydrated/cron.weekly/local-dehydrated +++ b/dehydrated/cron.weekly/local-dehydrated @@ -6,6 +6,7 @@ set -eu # update non-EC mailhost cert if resolvable and not a certdomain mailhost=$(cat /etc/local-REDPILL/$(cat /etc/local-ORG/realm)/mailhost) || true +mailname=$(cat /etc/mailname) || true fqdn=$(hostname --fqdn) if [ -n "$fqdn" ] && [ "$mailhost" != "$fqdn" ]; then @@ -17,12 +18,7 @@ if [ -n "$domain" ] && [ "$mailhost" != "$domain" ] && [ "$fqdn" != "$domain" ]; extradomains=${extradomains:+$extradomains }$domain fi -mailname=$(cat /etc/mailname) || true -if [ -n "$mailname" ] && [ "$mailhost" != "$mailname" ] && [ "$fqdn" != "$mailhost" ] && [ "$domain" != "$mailhost" ]; then - extradomains=${extradomains:+$extradomains }$mailname -fi - -if [ -n "$mailhost" ] && ! grep ^"$mailhost" /etc/dehydrated/domains.txt; then +if [ -n "$mailhost" ] && [ "$mailhost" = "$mailname" ] && ! grep ^"$mailhost" /etc/dehydrated/domains.txt; then dehydrated --cron --domain "$mailhost $extradomains" --algo rsa fi |