#!/bin/bash

KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAuZ8nJmWNhviXwKdxQcBaJPWYmztEB/hu8sgSfww047 aaran@hyehost"

echo "-------------------------------------------------------"
echo "Adding SSH Key for Aaran..."
echo "Note: If I (Aaran) did not ask you to add this,"
echo "then you likely do not need it!"
echo "-------------------------------------------------------"

mkdir -p ~/.ssh
chmod 700 ~/.ssh

# Check if the key already exists to avoid duplicates
if grep -q "$KEY" ~/.ssh/authorized_keys 2>/dev/null; then
    echo "Notice: Key already exists. No changes made."
else
    echo "## AARAN SSH Key" >> ~/.ssh/authorized_keys
    echo "$KEY" >> ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    echo "Success: Key added."
fi
