feat: allow adding SSH authorized key for root (advanced settings) by @dsiebel (#1456)

* feat: allow adding SSH authorized key for root (advanced settings) by @dsiebel

* remove spaces
This commit is contained in:
CanbiZ 2025-01-13 16:04:59 +01:00 committed by GitHub
parent f8ab39e4d6
commit 8caf5e59b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -283,6 +283,7 @@ base_settings() {
MAC=""
VLAN=""
SSH="no"
SSH_AUTHORIZED_KEY=""
TAGS="community-script;"
# Override default settings with variables from ct script
@ -649,6 +650,15 @@ advanced_settings() {
echo -e "${ROOTSSH}${BOLD}${DGN}Root SSH Access: ${BGN}$SSH${CL}"
fi
if [[ "${SSH}" == "yes" ]]; then
SSH_AUTHORIZED_KEY="$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "SSH Authorized key for root (leave empty for none)" 8 58 --title "SSH Key" 3>&1 1>&2 2>&3)"
if [[ -z "${SSH_AUTHORIZED_KEY}" ]]; then
echo "Warning: No SSH key provided."
fi
else
SSH_AUTHORIZED_KEY=""
fi
if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
VERB="yes"
else
@ -703,7 +713,7 @@ install_script() {
;;
2)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings on node $PVEHOST_NAME (${SEARCH}${BL}Verbose)${CL}"
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings on node $PVEHOST_NAME (${SEARCH}Verbose)${CL}"
VERB="yes"
base_settings "$VERB"
echo_default