infrastructure/scripts/ns-update.sh

14 lines
358 B
Bash
Raw Normal View History

#!@bash@/bin/bash
cd "$(@git@/bin/git rev-parse --show-toplevel)"
SERIAL=$(@coreutils@/bin/cat modules/dgn-dns/serial.nix)
T_SERIAL="$(@coreutils@/bin/date +'%Y%m%d')00"
N_SERIAL=$(( ( SERIAL >= T_SERIAL ? SERIAL : T_SERIAL ) + 1 ))
echo "New SOA serial: $N_SERIAL"
echo -n "$N_SERIAL" > modules/dgn-dns/serial.nix
@colmena@/bin/colmena apply --on @dns