Files
configpolicy/roles/minio-backups-cert/files/nsupdate-auth.sh
Dustin C. Hatch 4218137e1e r/minio-backups-cert: Fix nsupdate kinit for f42
The version of Samba in Fedora 42 has got some really weird bugs.  In
this case, it seems `net ads kerberos kinit -P` no longer works.  It
prints a vague `NT_STATUS_INTERNAL_ERROR` message, with no other
indication of what went wrong.  Fortunately, it's still possible to get
a ticket-granting ticket for the machine account using the host keytab.
2025-07-12 16:08:21 -05:00

20 lines
440 B
Bash
Executable File

#!/bin/sh
export KRB5CCNAME=/run/certbot.krb5_ccache
klist -s || kinit -kt /etc/krb5.keytab "$(hostname -s | tr a-z A-Z)"'$' || exit
nsupdate -g <<EOF || exit
zone $(dnsdomainname)
update add _acme-challenge.${CERTBOT_DOMAIN} 10 TXT ${CERTBOT_VALIDATION}
send
EOF
while :; do
t=$(dig +short -t txt _acme-challenge.${CERTBOT_DOMAIN})
case "$t" in
*\"${CERTBOT_VALIDATION}\"*)
break
;;
esac
sleep 1
done