#!/bin/bash # FILE: wgapi:back/lib/ns/update/del # DESCRIPTION: Use nsupdate to delete host RRs # USAGE: del domain ipv4 ipv6 # ERRORS: # 3: Bad usage # 4: Config not found # 5: nsupdate failed CONFIG_FILE='/etc/wgapi/config' [ ${#} -eq 3 ] || exit 3 [ -f "${CONFIG_FILE}" ] || exit 5 source "${CONFIG_FILE}" # Keep these updates seperate because the zones are different ( "${LIB_DIR}/ns_update_send" "update delete ${1}. A\nupdate delete ${1}. AAAA\n update delete *.${1}. CNAME" "${LIB_DIR}/ns_update_send" "update delete $(./rev_ipv4 "${2}") PTR" "${LIB_DIR}/ns_update_send" "update delete $(./rev_ipv6 "${3}") PTR" ) || exit 5