Projects
home:rottame:yggdra_agents
dns_authoritative_provisioner
pdns_zone_info
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pdns_zone_info of Package dns_authoritative_provisioner
#!/bin/sh # Source pdns_env if present if [ -f /etc/dns_authoritative_provisioner/pdns_env ]; then . /etc/dns_authoritative_provisioner/pdns_env fi # Set default PDNSUTIL_BIN if not set if [ -z "$PDNSUTIL_BIN" ]; then PDNSUTIL_BIN="/usr/bin/pdnsutil" fi # Check that exactly one parameter is provided if [ $# -ne 1 ]; then echo "Usage: $0 <zone>" >&2 exit 1 fi ZONE="$1" # First check if zone exists using list-zone (more reliable than show-zone for existence check) ZONE_LIST_OUTPUT=$("$PDNSUTIL_BIN" list-zone "$ZONE" 2>&1) LIST_EXIT_CODE=$? # If zone doesn't exist, output JSON with active: false if [ $LIST_EXIT_CODE -ne 0 ]; then echo "{\"zone\":\"$ZONE\",\"active\":false,\"secure\":false,\"dynamic\":false,\"frozen\":false}" exit 0 fi # Zone exists, now check for DNSSEC keys KEYS_OUTPUT=$("$PDNSUTIL_BIN" list-keys "$ZONE" 2>&1) KEYS_EXIT_CODE=$? # Check secure status (DNSSEC) # If list-keys succeeds and returns output, zone has keys (is signed) SECURE="no" if [ $KEYS_EXIT_CODE -eq 0 ]; then # Check if there's actual key output (not just empty or error message) if echo "$KEYS_OUTPUT" | grep -qE "^[^[:space:]]+[[:space:]]+[0-9]+"; then SECURE="yes" fi fi # PowerDNS zones via bind backend aren't dynamic DYNAMIC="no" # PowerDNS doesn't have a "frozen" concept like BIND # This is a BIND-specific feature, so always false for PowerDNS FROZEN="no" # Convert yes/no to boolean if [ "$SECURE" = "yes" ]; then SECURE_BOOL="true" else SECURE_BOOL="false" fi if [ "$DYNAMIC" = "yes" ]; then DYNAMIC_BOOL="true" else DYNAMIC_BOOL="false" fi if [ "$FROZEN" = "yes" ]; then FROZEN_BOOL="true" else FROZEN_BOOL="false" fi # Zone is active if we got here (command succeeded) # Output JSON echo "{\"zone\":\"$ZONE\",\"active\":true,\"secure\":$SECURE_BOOL,\"dynamic\":$DYNAMIC_BOOL,\"frozen\":$FROZEN_BOOL}" exit 0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.