operator-installer/01-setup-user.sh

36 lines
No EOL
1.1 KiB
Bash
Executable file

#!/bin/bash -eu
# Run this as your Linux user — NOT as root
if [ "$EUID" -eq 0 ]; then
echo "Please run this script as your Linux user, not as root"
exit 1
fi
echo "=== Detecting IPv6 ==="
IPV6_ADDRESSES=$(ip -6 addr show | grep -oP 'inet6 \K[0-9a-fA-F:]+' | grep -v '^::1$' || true)
if [ -n "$IPV6_ADDRESSES" ]; then
echo "IPv6 is enabled. Addresses:"
echo "$IPV6_ADDRESSES"
IPV6_RESULT="IPv6 Enabled"
else
echo "IPv6 is not enabled."
IPV6_RESULT="IPv4 Only"
fi
echo ""
echo "=== Generating SSH key for repo access ==="
mkdir -p ~/.ssh
echo "Hit Enter for the default path and leave the passphrase empty (press Enter twice)."
ssh-keygen -t ed25519
echo ""
echo "================================================================"
echo "Give Simplified Privacy the following information:"
echo ""
echo "1) Your SSH public key:"
echo ""
cat ~/.ssh/id_ed25519.pub
echo ""
echo "2) Your IPv6 status: ${IPV6_RESULT}"
echo "================================================================"
echo ""
echo "Once SP has whitelisted your SSH key, run ~/02-install.sh"