-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns_auth_hook.sh
16 lines (12 loc) · 696 Bytes
/
dns_auth_hook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
echo "Running auth hook for domain: $CERTBOT_DOMAIN with validation string $CERTBOT_VALIDATION"
# the env var PROXY_FOR_CERTBOT_DNS_HOOK is the proxy to be used
if [ -z "$PROXY_FOR_CERTBOT_DNS_HOOK" ]; then
echo "No proxy provided."
cargo run -- certbot --operation=set-record --domain-name=$CERTBOT_DOMAIN --validation-string=$CERTBOT_VALIDATION
else
echo "Proxy provided: $PROXY_FOR_CERTBOT_DNS_HOOK"
cargo run -- certbot --operation=set-record --domain-name=$CERTBOT_DOMAIN --validation-string=$CERTBOT_VALIDATION --proxy=$PROXY_FOR_CERTBOT_DNS_HOOK
fi
echo "Done running auth hook for domain: $CERTBOT_DOMAIN with validation string $CERTBOT_VALIDATION"
exit 0