[scripts] make pwpath consistant

This commit is contained in:
ahtlon
2025-02-23 13:16:17 +01:00
committed by kalipso
parent 02292085ef
commit 2297dec03d
2 changed files with 14 additions and 13 deletions

View File

@@ -2,7 +2,7 @@ set -o errexit
set -o pipefail
sshoptions="-o StrictHostKeyChecking=no -o ServerAliveInterval=1 -o ServerAliveCountMax=1 -p 222 -T"
HOSTNAME=$1
hostname=$1
if [ ! -e flake.nix ]
then
@@ -19,17 +19,17 @@ if [ ! -e flake.nix ]
done
fi
diskkey=$(sops -d machines/$HOSTNAME/secrets/disk.key)
diskkey=$(sops -d machines/$hostname/secrets/disk.key)
echo
if [ $# = 1 ]
then
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "systemd-tty-ask-password-agent" #root
elif [ $# = 2 ]
then
IP=$2
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root
ip=$2
echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent" #root
else
echo