nixos/estuary: Fix pdns-file-records clobbering .dat ownership
This commit is contained in:
parent
77eaaf52c7
commit
daa4ed45f5
@ -13,7 +13,7 @@ let
|
|||||||
|
|
||||||
pdns-file-record = pkgs.writeShellApplication {
|
pdns-file-record = pkgs.writeShellApplication {
|
||||||
name = "pdns-file-record";
|
name = "pdns-file-record";
|
||||||
runtimeInputs = with pkgs; [ gnused pdns ];
|
runtimeInputs = with pkgs; [ gnused moreutils pdns ];
|
||||||
text = ''
|
text = ''
|
||||||
die() {
|
die() {
|
||||||
echo "$@" >&2
|
echo "$@" >&2
|
||||||
@ -69,7 +69,8 @@ let
|
|||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$zDat"
|
source "$zDat"
|
||||||
((serial++))
|
((serial++))
|
||||||
sed -i "s/^serial=.*$/serial=$serial/g" "$zDat"
|
# Use sponge instead of `sed -i` because that actually uses a temporary file and clobbers ownership...
|
||||||
|
sed "s/^serial=.*$/serial=$serial/g" "$zDat" | sponge "$zDat"
|
||||||
sed "s/@@SERIAL@@/$serial/g" < /etc/pdns/bind-zones/"$zone".zone > /run/pdns/bind-zones/"$zone".zone
|
sed "s/@@SERIAL@@/$serial/g" < /etc/pdns/bind-zones/"$zone".zone > /run/pdns/bind-zones/"$zone".zone
|
||||||
pdns_control bind-reload-now "$zone"
|
pdns_control bind-reload-now "$zone"
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user