#!/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' [ ${#} -eq 1 ] || exit 3 [ -f "${CONFIG_FILE}" ] || exit 4 source "${CONFIG_FILE}" printf 'server %s\n%s\nsend\n' "${DNS_MASTER}" "${1}" \ | nsupdate -y "${DNS_KEY}" | tee -a "${LOGFILE}"