summaryrefslogtreecommitdiff
path: root/dehydrated
diff options
context:
space:
mode:
Diffstat (limited to 'dehydrated')
-rwxr-xr-xdehydrated/cron.weekly/local-dehydrated22
1 files changed, 11 insertions, 11 deletions
diff --git a/dehydrated/cron.weekly/local-dehydrated b/dehydrated/cron.weekly/local-dehydrated
index 861169f..9ec2acd 100755
--- a/dehydrated/cron.weekly/local-dehydrated
+++ b/dehydrated/cron.weekly/local-dehydrated
@@ -6,22 +6,22 @@ set -eu
REALM=$(cat /etc/local-ORG/realm) || true
-# update non-EC mailhost cert if resolvable and not a certdomain
mailhost=$(cat "/etc/local-REDPILL/$REALM/mailhost") || true
mailname=$(cat /etc/mailname) || true
-
fqdn=$(hostname --fqdn)
-if [ -n "$fqdn" ] && [ "$mailhost" != "$fqdn" ]; then
- extradomains=${extradomains:+$extradomains }$fqdn
-fi
-
domain=$(hostname --domain)
-if [ -n "$domain" ] && [ "$mailhost" != "$domain" ] && [ "$fqdn" != "$domain" ]; then
- extradomains=${extradomains:+$extradomains }$domain
-fi
-if [ -n "$mailhost" ] && [ "$mailhost" = "$mailname" ] && ! grep ^"$mailhost" /etc/dehydrated/domains.txt; then
- dehydrated --cron --domain "$mailhost $extradomains" --algo rsa
+# update non-EC mailhost cert if resolvable and not a certdomain
+if [ -n "$mailhost" ]; then
+ if [ -n "$fqdn" ] && [ "$mailhost" != "$fqdn" ]; then
+ extradomains=${extradomains:+$extradomains }$fqdn
+ fi
+ if [ -n "$domain" ] && [ "$mailhost" != "$domain" ] && [ "$fqdn" != "$domain" ]; then
+ extradomains=${extradomains:+$extradomains }$domain
+ fi
+ if [ "$mailhost" = "$mailname" ] && ! grep ^"$mailhost" /etc/dehydrated/domains.txt; then
+ dehydrated --cron --domain "$mailhost $extradomains" --algo rsa
+ fi
fi
# update certdomain certs