provision_vps() { LABEL="$1" REGION="$2" TYPE="$3" IMAGE="$4" ROOT_PASS="${5:-$(openssl rand -base64 16)}" if [[ "$LINODE_API_TOKEN" == "REPLACE_WITH_YOUR_LINODE_API_TOKEN" ]]; then echo "āŒ Error: You must set your LINODE_API_TOKEN at the top of this script." exit 1 fi CLOUD_INIT=$(cat </dev/null || true systemctl disable linode-cloudinit 2>/dev/null || true touch /etc/cloud/cloud-init.disabled rm -rf /etc/cloud /var/lib/cloud /var/log/cloud-init.log rm -f /etc/motd /etc/update-motd.d/linode rm -rf /usr/share/linode* rm -f /etc/apt/sources.list.d/linode.list apt remove --purge -y linode-cli linode-config 2>/dev/null || true echo "[genesisctl] Attempting to log to Krang via webhook..." >> /var/log/genesis-harden.log curl -s -X POST -H "Content-Type: application/json" \ -d "{\"host\": \"$GEN_HOSTNAME\", \"ip\": \"$IP_ADDR\", \"timestamp\": \"$(date)\"}" \ http://krang.core.sshjunkie.com:8080/genesislog >> /var/log/genesis-harden.log 2>&1 || echo "[genesisctl] Krang webhook logging failed" >> /var/log/genesis-harden.log touch /var/log/genesis-hardened.ok runcmd: - [ bash, /usr/local/bin/genesis_squeaky.sh ] EOF ) USER_DATA=$(echo "$CLOUD_INIT" | base64 -w 0) echo "Provisioning VPS '$LABEL' in $REGION with type $TYPE and image $IMAGE..." TMP_FILE=$(mktemp) JSON_PAYLOAD=$(cat <> /home/doc/vpslogs/pending_rdns.log }