handle the case of metadata 404 in old api domains
fix index of domain start
fix shfmt
Revert "handle the case of metadata 404 in old api domains"
This reverts commit 9fe4616664.
fix 404 on dot ad hyphen
fix shfmt
- Fix array handling for 3+ domains by detecting if content is already
an array and extracting all existing values correctly
- Restructure code following dns_cf.sh best practices
- Add better debug output ("Getting txt records", "Adding record")
- Improve error handling and make error messages consistent
- Ensure wildcard certificates work correctly with multiple TXT values
The previous implementation used simple string trimming which only
worked for single-value content fields. When content was already an
array (2nd domain onwards), only the first character was extracted,
causing data loss and failures for 3+ domains.
Now properly detects array vs string format using grep and extracts
all existing values before appending new ones, preserving all TXT
records.
- Added _get_root() helper function for proper zone detection
- Fixed zone ID extraction to match dns/auth_zone/* pattern
- Added _infoblox_rest() wrapper for API calls with proper auth
- Improved error handling for authentication failures
- Added support for wildcard certificates (multiple TXT records)
- Filter by exact txtvalue when deleting records
- Follow acme.sh best practices and conventions
Tested with:
- Standard domain certificates
- Wildcard certificates (*.domain.com)
- Multiple subdomains
- Staging and production Let's Encrypt