17 lines
541 B
Bash
Executable File
17 lines
541 B
Bash
Executable File
#!/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
|
|
|
|
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"
|