From c3874a6de6f0d51016ba59c88263b0af71dc308a Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Tue, 28 Jan 2025 10:23:24 +0000 Subject: [PATCH] Update shell script shebangs Signed-off-by: Nikolaos Karaolidis --- lib/scripts/add-host.sh | 4 ++-- lib/scripts/remove-host.sh | 4 ++-- lib/scripts/update-keys.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/scripts/add-host.sh b/lib/scripts/add-host.sh index 604b024..e144340 100755 --- a/lib/scripts/add-host.sh +++ b/lib/scripts/add-host.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env -S nix shell nixpkgs#ssh-to-age -c bash set -o errexit set -o nounset @@ -15,7 +15,7 @@ mkdir -p "./hosts/$host/secrets" ssh-keygen -t ed25519 -f "./hosts/$host/secrets/ssh_host_ed25519_key" -N "" -age_key=$(nix shell nixpkgs#ssh-to-age --command bash -c "cat './hosts/$host/secrets/ssh_host_ed25519_key.pub' | ssh-to-age") +age_key=$(cat './hosts/$host/secrets/ssh_host_ed25519_key.pub' | ssh-to-age) find . -type f -name "sops.yaml" | while IFS= read -r sops_file; do sed -i "/- hosts:/a\ - &$host $age_key" "$sops_file" diff --git a/lib/scripts/remove-host.sh b/lib/scripts/remove-host.sh index 96c0e4e..0067d5c 100755 --- a/lib/scripts/remove-host.sh +++ b/lib/scripts/remove-host.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env -S nix shell nixpkgs#ssh-to-age -c bash set -o errexit set -o nounset @@ -11,7 +11,7 @@ fi 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") +age_key=$(cat './hosts/$host/secrets/ssh_host_ed25519_key.pub' | ssh-to-age) find . -type f -name "sops.yaml" | while IFS= read -r sops_file; do sed -i "/ - &$host $age_key/d" "$sops_file" diff --git a/lib/scripts/update-keys.sh b/lib/scripts/update-keys.sh index da304da..5d7d004 100755 --- a/lib/scripts/update-keys.sh +++ b/lib/scripts/update-keys.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env -S nix shell nixpkgs#sops -c bash set -o errexit set -o nounset @@ -18,6 +18,6 @@ find . -type f -name 'sops.yaml' | while IFS= read -r sops_file; do -regex '.+\.(yaml|yml|json|env|ini|bin)' \ ! -name 'sops.yaml' | while IFS= read -r file; do echo "$file" - nix shell nixpkgs#sops --command sops --config "$sops_file" updatekeys "$file" -y + sops --config "$sops_file" updatekeys "$file" -y done done