2022-08-29 01:04:37 -06:00
|
|
|
#!/bin/bash
|
|
|
|
# FILE: wgapi:back/lib/ns/update/send
|
|
|
|
# DESCRIPTION: Send stuff to the nsupdate server
|
|
|
|
# USAGE: send cmd
|
2022-09-06 20:57:41 -06:00
|
|
|
# ERRORS:
|
|
|
|
# 3: Bad usage
|
|
|
|
# 4: Missing config file
|
2022-08-29 01:04:37 -06:00
|
|
|
|
2022-09-06 20:57:41 -06:00
|
|
|
CONFIG_FILE='/etc/wgapi/config'
|
2022-09-10 09:05:34 -06:00
|
|
|
[ ${#} -eq 1 ] || exit 3
|
2022-09-06 20:57:41 -06:00
|
|
|
[ -f "${CONFIG_FILE}" ] || exit 4
|
|
|
|
source "${CONFIG_FILE}"
|
2022-09-08 21:15:30 -06:00
|
|
|
printf 'server %s\n%s\nsend\n' "${DNS_MASTER}" "${1}" \
|
2022-09-10 10:39:39 -06:00
|
|
|
| nsupdate -y "${DNS_KEY}" | tee -a "${LOGFILE}"
|