wagon/back/lib/ns_update_send

14 lines
357 B
Bash
Executable File

#!/bin/bash
# FILE: wgapi:back/lib/ns/update/send
# DESCRIPTION: Send stuff to the nsupdate server
# USAGE: send cmd
# ERRORS:
# 3: Bad usage
# 4: Missing config file
CONFIG_FILE='/etc/wgapi/config'
[ -f "${CONFIG_FILE}" ] || exit 4
source "${CONFIG_FILE}"
printf 'server %s\n%s\nsend\n' "${DNS_MASTER}" "${1}" \
| nsupdate -y "${DNS_KEY}"