DEBUGGING

This commit is contained in:
Raphael Numbus
2025-12-14 18:23:32 +01:00
parent a2291e1437
commit f1156d6cc6
+15 -16
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p gum xkcdpass openssl sops ssh-to-age age sshpass envsubst pciutils usbutils mosquitto #!nix-shell -i bash -p gum xkcdpass openssl sops ssh-to-age age sshpass envsubst pciutils usbutils mosquitto rsync
necessary_credentials() { necessary_credentials() {
#TARGET SETTINGS #TARGET SETTINGS
@@ -265,8 +265,13 @@ disk_config_generation() {
echo -e "\n\n 🔎 Fetching and analyzing disks from target host... (This may take a moment)" echo -e "\n\n 🔎 Fetching and analyzing disks from target host... (This may take a moment)"
### Disk wiping warning <-- ### Disk wiping warning <--
TMPFILE="/tmp/nixos-deployment-temp-file"
### --> Get disk information ### --> Get disk information
DISK_DETAILS=$(ssh_to_host " DISK_DETAILS=$(ssh_to_host "
TMPFILE="$TMPFILE"
# Declare arrays and variables # Declare arrays and variables
HDD=1 HDD=1
@@ -300,24 +305,18 @@ for DISK in \$(lsblk -x SIZE -d -n -o NAME); do
done done
# Print elements # Print elements
echo \"\${DISK_DEVPATH[@]}\" echo \"DISK_DEVPATH=(\${DISK_DEVPATH[@]})\" > \$TMPFILE
echo \"\${DISK_NAME[@]}\" echo \"DISK_NAME=(\${DISK_NAME[@]})\" > \$TMPFILE
echo \"\${DISK_TYPE[@]}\" echo \"DISK_TYPE=(\${DISK_TYPE[@]})\" > \$TMPFILE
echo \"\${DISK_HEALTH[@]}\" echo \"DISK_HEALTH=(\${DISK_HEALTH[@]})\" > \$TMPFILE
echo \"\${DISK_ID[@]}\" echo \"DISK_HEALTH=(\${DISK_ID[@]})\" > \$TMPFILE
echo \"\${DISK_SIZE[@]}\" echo \"DISK_SIZE=(\${DISK_SIZE[@]})\" > \$TMPFILE
" "
) )
# Get arrays back scp nixos@$TARGET_HOST:$TMPFILE .
readarray -t LINES <<<"$DISK_DETAILS" source nixos-deployment-temp-file
read -r -a DISK_DEVPATH <<<"${LINES[0]}" rm nixos-deployment-temp-file
read -r -a DISK_NAME <<<"${LINES[1]}"
read -r -a DISK_TYPE <<<"${LINES[2]}"
read -r -a DISK_HEALTH <<<"${LINES[3]}"
read -r -a DISK_ID <<<"${LINES[4]}"
read -r -a DISK_SIZE <<<"${LINES[5]}"
### Get disk information <--
### --> Disk selection ### --> Disk selection
TOTAL_NUMBER_OF_DISKS=${#DISK_NAME[@]} TOTAL_NUMBER_OF_DISKS=${#DISK_NAME[@]}