wagon/back/lib/ns_update_del

17 lines
541 B
Plaintext
Raw Normal View History

2022-08-29 01:04:37 -06:00
#!/bin/bash
# FILE: wgapi:back/lib/ns/update/del
# DESCRIPTION: Use nsupdate to delete host RRs
# USAGE: del domain ipv4 ipv6
2022-09-06 20:57:41 -06:00
# ERRORS:
# 3: Bad usage
# 4: Config not found
2022-08-29 01:04:37 -06:00
2022-09-06 20:57:41 -06:00
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
./send "update delete ${1}. A\nupdate delete ${1}. AAAA\n update delete *.${1}. CNAME"
./send "update delete $(./rev_ipv4 $2) PTR"
./send "update delete $(./rev_ipv6 $3) PTR"