random-stuff/bash_scripts/cloud-init-populate.sh

19 lines
545 B
Bash
Raw Normal View History

#!/usr/bin/bash
BASE_DIR=$(realpath "$(pwd)/$(dirname "$0")/..")
PUB_KEYS=($(ls ~/.ssh/*.pub | xargs -d '\n' -n 1 basename))
set -a
WRAPPER_SCRIPT=$(base64 $BASE_DIR/bash_scripts/ddns-acme-porkbun.sh -w 0)
DDNS_SCRIPT=$(base64 $BASE_DIR/python_scripts/ddns-porkbun.py -w 0)
read -p "VPS Username: " TARGET_USERNAME
echo $PUB_KEYS
select key_file in $PUB_KEYS
do
SSH_PUB_KEY=$(cat ~/.ssh/$key_file)
break
done
set +a
envsubst < $BASE_DIR/basic_configs/debian-hetzner-init.yaml | xclip -sel c
read -p 'Input when done'
echo -n ''| xclip -sel c