mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-24 21:47:26 +00:00
Move and improve ssh_check and shell_check functions
The ssh_check function was moved from build.func to core.func and enhanced to allow an override and to skip warnings for localhost connections. The shell_check function was simplified to directly check for Bash and provide clearer messaging. These changes centralize environment checks and improve user experience.
This commit is contained in:
@@ -239,25 +239,6 @@ update_motd_ip() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# ssh_check()
|
||||
#
|
||||
# - Detects if script is running over SSH
|
||||
# - Warns user and recommends using Proxmox shell
|
||||
# - User can choose to continue or abort
|
||||
# ------------------------------------------------------------------------------
|
||||
ssh_check() {
|
||||
if [ -n "${SSH_CLIENT:+x}" ]; then
|
||||
if whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --defaultno --title "SSH DETECTED" --yesno "It's advisable to utilize the Proxmox shell rather than SSH, as there may be potential complications with variable retrieval. Proceed using SSH?" 10 72; then
|
||||
whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox --title "Proceed using SSH" "You've chosen to proceed using SSH. If any issues arise, please run the script in the Proxmox shell before creating a repository issue." 10 72
|
||||
else
|
||||
clear
|
||||
echo "Exiting due to SSH usage. Please consider using the Proxmox shell."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# install_ssh_keys_into_ct()
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user