Fix utility script bugs

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-20 10:00:01 +00:00
parent dbc913fcd8
commit 6c32412fa3
7 changed files with 35 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ HOST="$1"
AGE_KEY=$(nix shell nixpkgs#ssh-to-age --command bash -c "cat './hosts/${HOST}/secrets/ssh_host_ed25519_key.pub' | ssh-to-age")
for SOPS_FILE in $(find . -type f -name "sops.yaml"); do
find . -type f -name "sops.yaml" | while IFS= read -r SOPS_FILE; do
sed -i "/ - &${HOST} ${AGE_KEY}/d" "${SOPS_FILE}"
sed -i "/ - \*${HOST}/d" "${SOPS_FILE}"
done