From 189f2bfec9a90c5bd1d9736549eab53301372e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Numbus?= Date: Sat, 17 Jan 2026 15:13:31 +0100 Subject: [PATCH] Fixed bad redirections. Added variables to deploy.conf. Other misc changes --- deploy.conf | 2 ++ deploy.sh | 7 ++++--- templates/nix-config/misc/smart.nix | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy.conf b/deploy.conf index 5be3d33..5c796ef 100644 --- a/deploy.conf +++ b/deploy.conf @@ -1,6 +1,8 @@ #TARGET SETTINGS export TARGET_HOST="192.168.1.10" +export REMOTE_PASS="example" export SSH_PUBLIC_KEY="ssh-ed25519 AAAAoefzefpoipoeCEZJCPEACPAcjapjcpajepcjAPJECJPEJAPJAZ yours@yourdomain.com" +export SERVER_OWNER_NAME="yourName" # TRAEFIK SETTINGS export DOMAIN_NAME="yourdomain.com" diff --git a/deploy.sh b/deploy.sh index 4e4116c..02332a9 100644 --- a/deploy.sh +++ b/deploy.sh @@ -123,7 +123,7 @@ setup_ssh() { echo -e "\n\n➡️ Copying SSH key to target host '${TARGET_USER}@${TARGET_HOST}'..." if sshpass -p "${REMOTE_PASS}" ssh-copy-id -o StrictHostKeyChecking=no -i "final-nix-config/home/numbus-admin/.ssh/id_ed25519" "${TARGET_USER}@${TARGET_HOST}"; then - echo -e "\n✅ SSH key copied successfully." + echo -e "\n✅ SSH key copied successfully" else echo -e "\n❌ Failed to copy SSH key. Please check the host IP and password." exit 1 @@ -141,7 +141,7 @@ hardware_detection() { ssh_to_host 'bash -s' << SSHEND for brand in Intel AMD NVIDIA; do - if lspci -nn > /dev/null 2>&1 | grep -i "vga" | grep -iq "\${brand}"; then + if lspci -nn 2>/dev/null | grep -i "vga" | grep -iq "\${brand}"; then TARGET_GRAPHICS="true" TARGET_GRAPHICS_BRAND+=("\${brand}") else @@ -186,7 +186,8 @@ for DISK in \$(lsblk -x SIZE -d -n -e 7,11 -o NAME); do else DISK_TYPE+=("Other") fi # Disk health - if [[ \$(echo "$REMOTE_PASS" | sudo -S smartctl -H /dev/\$DISK > /dev/null 2>&1 | grep 'self-assessment' | awk '{print \$6}') == "PASSED" ]]; then + + if [[ \$(echo "$REMOTE_PASS" | sudo -S smartctl -H /dev/\$DISK 2>/dev/null | grep 'self-assessment' | awk '{print \$6}') == "PASSED" ]]; then DISK_HEALTH+=("PASSED") else DISK_HEALTH+=("N/A") diff --git a/templates/nix-config/misc/smart.nix b/templates/nix-config/misc/smart.nix index e352a7c..ca20ba5 100644 --- a/templates/nix-config/misc/smart.nix +++ b/templates/nix-config/misc/smart.nix @@ -22,8 +22,8 @@ let printf "Subject: [ADMIN] $SUBJECT\n\n$TECH_BODY" | /run/wrappers/bin/sendmail -t "$ADMIN_EMAIL" # 2. Send Friendly Email to Owner - OWNER_NAME=$(cat /etc/numbus-server/owner 2>/dev/null || echo "User") USER_EMAIL="${config.email.userAddress}" + OWNER_NAME=$(cat /etc/numbus-server/owner 2>/dev/null || echo "User") FRIENDLY_BODY="Cher/Chère $OWNER_NAME,