|
|
@ -146,9 +146,10 @@ EOF |
|
|
|
# Git |
|
|
|
# Git |
|
|
|
apt-get update && apt-get -y install git |
|
|
|
apt-get update && apt-get -y install git |
|
|
|
|
|
|
|
|
|
|
|
#!/bin/bash |
|
|
|
# Create the config.d directory if it doesn't exist |
|
|
|
|
|
|
|
mkdir -p ~/.ssh/config.d |
|
|
|
|
|
|
|
|
|
|
|
# Generate SSH key |
|
|
|
# Generate SSH key and create SSH config |
|
|
|
for key_type in all https runner; do |
|
|
|
for key_type in all https runner; do |
|
|
|
ssh-keygen -t ed25519 -f ~/.ssh/ed25519_01edu_$key_type -N '' |
|
|
|
ssh-keygen -t ed25519 -f ~/.ssh/ed25519_01edu_$key_type -N '' |
|
|
|
|
|
|
|
|
|
|
@ -159,8 +160,10 @@ EOF |
|
|
|
IdentityFile ~/.ssh/ed25519_01edu_$key_type" >~/.ssh/config.d/01-edu-$key_type.conf |
|
|
|
IdentityFile ~/.ssh/ed25519_01edu_$key_type" >~/.ssh/config.d/01-edu-$key_type.conf |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# Include custom SSH configurations from the config directory |
|
|
|
# Include custom SSH configurations from the config directory if not already included |
|
|
|
echo "Include ~/.ssh/config.d/*.conf" >>~/.ssh/config |
|
|
|
if ! grep -q "Include ~/.ssh/config.d/*.conf" ~/.ssh/config; then |
|
|
|
|
|
|
|
echo "Include ~/.ssh/config.d/*.conf" >>~/.ssh/config |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Use Cloudflare DNS server |
|
|
|
# Use Cloudflare DNS server |
|
|
|
echo 'supersede domain-name-servers 1.1.1.1;' >>/etc/dhcp/dhclient.conf |
|
|
|
echo 'supersede domain-name-servers 1.1.1.1;' >>/etc/dhcp/dhclient.conf |
|
|
@ -188,9 +191,9 @@ function checkConfig() { |
|
|
|
|
|
|
|
|
|
|
|
function checkKeys() { |
|
|
|
function checkKeys() { |
|
|
|
# Check if SSH key pairs are generated |
|
|
|
# Check if SSH key pairs are generated |
|
|
|
if [ -f ~/.ssh/ed25519_01edu_all ] && [ -f ~/.ssh/ed25519_01edu_all.pub ] && |
|
|
|
if test -f ~/.ssh/ed25519_01edu_all && test -f ~/.ssh/ed25519_01edu_all.pub && |
|
|
|
[ -f ~/.ssh/ed25519_01edu_https ] && [ -f ~/.ssh/ed25519_01edu_https.pub ] && |
|
|
|
test -f ~/.ssh/ed25519_01edu_https && test -f ~/.ssh/ed25519_01edu_https.pub && |
|
|
|
[ -f ~/.ssh/ed25519_01edu_runner ] && [ -f ~/.ssh/ed25519_01edu_runner.pub ]; then |
|
|
|
test -f ~/.ssh/ed25519_01edu_runner && test -f ~/.ssh/ed25519_01edu_runner.pub; then |
|
|
|
echo "✅ SSH private/public key pairs generated" |
|
|
|
echo "✅ SSH private/public key pairs generated" |
|
|
|
|
|
|
|
|
|
|
|
# Echo public keys |
|
|
|
# Echo public keys |
|
|
|