mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-07 16:29:18 +00:00
Compare commits
No commits in common. "5d97fcdecf0f22b950c9cdef077fc7c517906647" and "945d55f4234b8d669a6f7170ceab6ef87d2a726b" have entirely different histories.
5d97fcdecf
...
945d55f423
@ -15,7 +15,9 @@ YW=$(echo "\033[33m")
|
|||||||
YWB=$(echo "\033[93m")
|
YWB=$(echo "\033[93m")
|
||||||
BL=$(echo "\033[36m")
|
BL=$(echo "\033[36m")
|
||||||
RD=$(echo "\033[01;31m")
|
RD=$(echo "\033[01;31m")
|
||||||
|
BGN=$(echo "\033[4;92m")
|
||||||
GN=$(echo "\033[1;92m")
|
GN=$(echo "\033[1;92m")
|
||||||
|
DGN=$(echo "\033[32m")
|
||||||
|
|
||||||
# Formatting
|
# Formatting
|
||||||
CL=$(echo "\033[m")
|
CL=$(echo "\033[m")
|
||||||
@ -64,7 +66,7 @@ function spinner() {
|
|||||||
# This function displays an informational message with a yellow color.
|
# This function displays an informational message with a yellow color.
|
||||||
function msg_info() {
|
function msg_info() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}"
|
echo -ne "${TAB}${YW}${msg}"
|
||||||
spinner &
|
spinner &
|
||||||
SPINNER_PID=$!
|
SPINNER_PID=$!
|
||||||
}
|
}
|
||||||
@ -139,14 +141,11 @@ function select_storage() {
|
|||||||
"Which storage pool you would like to use for the ${CONTENT_LABEL,,}?\nTo make a selection, use the Spacebar.\n" \
|
"Which storage pool you would like to use for the ${CONTENT_LABEL,,}?\nTo make a selection, use the Spacebar.\n" \
|
||||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||||
"${MENU[@]}" 3>&1 1>&2 2>&3) || exit "Menu aborted."
|
"${MENU[@]}" 3>&1 1>&2 2>&3) || exit "Menu aborted."
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo -e "${CROSS}${RD} Menu aborted by user.${CL}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
printf "%s" "$STORAGE"
|
printf $STORAGE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test if required variables are set
|
# Test if required variables are set
|
||||||
[[ "${CTID:-}" ]] || exit "You need to set 'CTID' variable."
|
[[ "${CTID:-}" ]] || exit "You need to set 'CTID' variable."
|
||||||
[[ "${PCT_OSTYPE:-}" ]] || exit "You need to set 'PCT_OSTYPE' variable."
|
[[ "${PCT_OSTYPE:-}" ]] || exit "You need to set 'PCT_OSTYPE' variable."
|
||||||
|
@ -91,7 +91,7 @@ spinner() {
|
|||||||
# This function displays an informational message with a yellow color.
|
# This function displays an informational message with a yellow color.
|
||||||
msg_info() {
|
msg_info() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}"
|
echo -ne "${TAB}${YW}${msg}"
|
||||||
spinner &
|
spinner &
|
||||||
SPINNER_PID=$!
|
SPINNER_PID=$!
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ base_settings() {
|
|||||||
DISK_SIZE="4"
|
DISK_SIZE="4"
|
||||||
CORE_COUNT="1"
|
CORE_COUNT="1"
|
||||||
RAM_SIZE="1024"
|
RAM_SIZE="1024"
|
||||||
VERBOSE="${1:-no}"
|
VERBOSE="no"
|
||||||
PW=""
|
PW=""
|
||||||
CT_ID=$NEXTID
|
CT_ID=$NEXTID
|
||||||
HN=$NSAPP
|
HN=$NSAPP
|
||||||
@ -587,56 +587,21 @@ install_script() {
|
|||||||
NEXTID=$(pvesh get /cluster/nextid)
|
NEXTID=$(pvesh get /cluster/nextid)
|
||||||
timezone=$(cat /etc/timezone)
|
timezone=$(cat /etc/timezone)
|
||||||
header_info
|
header_info
|
||||||
while true; do
|
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
|
||||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \
|
|
||||||
12 50 4 \
|
|
||||||
"1" "Default Settings" \
|
|
||||||
"2" "Default Settings (with verbose)" \
|
|
||||||
"3" "Advanced Settings" \
|
|
||||||
"4" "Exit" --nocancel --default-item "1" 3>&1 1>&2 2>&3)
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo -e "${CROSS}${RD} Menu canceled. Exiting.${CL}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $CHOICE in
|
|
||||||
1)
|
|
||||||
header_info
|
header_info
|
||||||
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings${CL}"
|
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings${CL}"
|
||||||
VERB="no"
|
base_settings
|
||||||
base_settings "$VERB"
|
|
||||||
echo_default
|
echo_default
|
||||||
break
|
else
|
||||||
;;
|
|
||||||
2)
|
|
||||||
header_info
|
|
||||||
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (${SEARCH} Verbose)${CL}"
|
|
||||||
VERB="yes"
|
|
||||||
base_settings "$VERB"
|
|
||||||
echo_default
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
header_info
|
header_info
|
||||||
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
|
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
|
||||||
advanced_settings
|
advanced_settings
|
||||||
break
|
fi
|
||||||
;;
|
|
||||||
4)
|
|
||||||
echo -e "${CROSS}${RD}Exiting.${CL}"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "${CROSS}${RD}Invalid option, please try again.${CL}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_container_resources() {
|
check_container_resources() {
|
||||||
# Check actual RAM & Cores
|
# Check actual RAM & Cores
|
||||||
current_ram=$(free -m | awk 'NR==2{print $2}')
|
current_ram=$(free -m | awk '/^Mem:/{print $2}')
|
||||||
current_cpu=$(nproc)
|
current_cpu=$(nproc)
|
||||||
|
|
||||||
# Check whether the current RAM is less than the required RAM or the CPU cores are less than required
|
# Check whether the current RAM is less than the required RAM or the CPU cores are less than required
|
||||||
|
@ -17,7 +17,6 @@ color() {
|
|||||||
CL=$(echo "\033[m")
|
CL=$(echo "\033[m")
|
||||||
BFR="\\r\\033[K"
|
BFR="\\r\\033[K"
|
||||||
BOLD=$(echo "\033[1m")
|
BOLD=$(echo "\033[1m")
|
||||||
HOLD=" "
|
|
||||||
TAB=" "
|
TAB=" "
|
||||||
|
|
||||||
# System
|
# System
|
||||||
@ -87,7 +86,7 @@ spinner() {
|
|||||||
# This function displays an informational message with a yellow color.
|
# This function displays an informational message with a yellow color.
|
||||||
msg_info() {
|
msg_info() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}"
|
echo -ne "${TAB}${YW}${msg}"
|
||||||
spinner &
|
spinner &
|
||||||
SPINNER_PID=$!
|
SPINNER_PID=$!
|
||||||
}
|
}
|
||||||
@ -219,10 +218,11 @@ motd_ssh() {
|
|||||||
if [ -f "$MOTD_FILE" ]; then
|
if [ -f "$MOTD_FILE" ]; then
|
||||||
# Start MOTD with application info and link
|
# Start MOTD with application info and link
|
||||||
echo -e "\n${BOLD}${APPLICATION} LXC Container${CL}" > "$MOTD_FILE"
|
echo -e "\n${BOLD}${APPLICATION} LXC Container${CL}" > "$MOTD_FILE"
|
||||||
echo -e "${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE"
|
echo -e "${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| Project: ${GN}ProxmoxVE ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE"
|
||||||
|
|
||||||
# Add system information with icons
|
# Add system information with icons
|
||||||
echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}" >> "$MOTD_FILE"
|
echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} ${OS_VERSION}${CL}" >> "$MOTD_FILE"
|
||||||
|
echo -e "${TAB}${OSVERSION}${YW} Version: ${GN}${OS_VERSION}${CL}" >> "$MOTD_FILE"
|
||||||
echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE"
|
echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE"
|
||||||
echo -e "${TAB}${INFO}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
|
echo -e "${TAB}${INFO}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user