From c83ea26c932bd9b3f9b340b85f9cbf5b0096ddb6 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sat, 13 Jan 2024 21:42:22 +0100 Subject: Configure SSH and WireGuard for btl --- regenerate-secrets.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'regenerate-secrets.sh') diff --git a/regenerate-secrets.sh b/regenerate-secrets.sh index 6b31a24c..f5a448b2 100755 --- a/regenerate-secrets.sh +++ b/regenerate-secrets.sh @@ -4,7 +4,7 @@ encto () { # Overwriting an existing encrypted file will change its content, even if # its decrypted content does not change, so leave it alone. [ -e "$2" ] && return 0 - hostkey=$(awk '$1 ~ /^\[?'"$1"'(\.twilken\.net|\.local|\.fritz\.box)\]?(:[0-9]+)?$/ && $2 == "ssh-ed25519" { print $2, $3 }' ~/.ssh/known_hosts) + hostkey=$(awk '$1 ~ /^\[?'"$1"'\.(twilken\.net|local|fritz\.box)\]?(:[0-9]+)?$/ && $2 == "ssh-ed25519" { print $2, $3 }' ~/.ssh/known_hosts) age -e -a -r "${hostkey:?No hostkey found for $1}" -o "$2" } @@ -21,9 +21,9 @@ store_restic () { } # Wireguard secret keys and pre-shared keys. -for host in lap lud vin frm; do +for host in lap lud vin frm btl; do store "$host" "computers/wireguard/private/$host" "tw/services/files/wireguard/$host.key.enc" - for host2 in lap lud vin pi3 fp4 frm; do + for host2 in lap lud vin pi3 fp4 frm btl; do [ $host = $host2 ] && continue store "$host" "computers/wireguard/preshared/$host-$host2" "tw/services/files/wireguard/$host-$host2.psk.enc" done -- cgit v1.2.3