#!/bin/bash # Setup SSH config for NUC server SSH_CONFIG="$HOME/.ssh/config" NUC_CONFIG="Host nuc HostName 192.168.1.3 User alezmad IdentityFile ~/.ssh/id_ed25519_nuc" # Check if nuc config already exists if grep -q "Host nuc" "$SSH_CONFIG" 2>/dev/null; then echo "NUC SSH config already exists in $SSH_CONFIG" else echo "Adding NUC config to $SSH_CONFIG" echo "" >> "$SSH_CONFIG" echo "$NUC_CONFIG" >> "$SSH_CONFIG" echo "Done! You can now connect with: ssh nuc" fi # Test connection echo "" echo "Testing connection..." ssh -o ConnectTimeout=5 nuc "echo 'Successfully connected to NUC!'" 2>/dev/null || echo "Connection failed. Make sure the SSH key exists at ~/.ssh/id_ed25519_nuc"