From c546999220f20e9f2391f916d33a3edb29835b38 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Tue, 5 Sep 2023 13:27:28 +0500 Subject: [PATCH] Added script to gen cloud-init cfg and copy --- bash_scripts/cloud-init-populate.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bash_scripts/cloud-init-populate.sh diff --git a/bash_scripts/cloud-init-populate.sh b/bash_scripts/cloud-init-populate.sh new file mode 100755 index 0000000..91b62a1 --- /dev/null +++ b/bash_scripts/cloud-init-populate.sh @@ -0,0 +1,18 @@ +#!/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