Compare commits

..

No commits in common. "9d7372b679bfb77406478d1eac80e35cc8821a11" and "885f5a9a2b020083a224fc06eb3841f25b100d9d" have entirely different histories.

1 changed files with 12 additions and 23 deletions

View File

@ -84,19 +84,9 @@ function msg_error() {
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }
function check_root() {
if [[ "$(id -u)" -ne 0 || $(ps -o comm= -p $PPID) == "sudo" ]]; then
clear
msg_error "Please run this script as root."
echo -e "\nExiting..."
sleep 2
exit
fi
}
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/(7\.[2-9]|8\.[0-9])"; then if ! pveversion | grep -Eq "pve-manager/(7\.[2-9]|8\.[0-9])"; then
msg_error "This version of Proxmox Virtual Environment is not supported" echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE Version 7.2 or higher" echo -e "Requires PVE Version 7.2 or higher"
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
@ -106,7 +96,7 @@ function pve_check() {
function arch_check() { function arch_check() {
if [ "$(dpkg --print-architecture)" != "amd64" ]; then if [ "$(dpkg --print-architecture)" != "amd64" ]; then
msg_error "This script will not work with PiMox! \n" echo -e "\n ${CROSS} This script will not work with PiMox! \n"
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit
@ -137,9 +127,9 @@ function default_settings() {
VMID="$NEXTID" VMID="$NEXTID"
FORMAT=",efitype=4m" FORMAT=",efitype=4m"
MACHINE="" MACHINE=""
DISK_CACHE="cache=writethrough," DISK_CACHE=""
HN="haos$stable" HN="haos$stable"
CPU_TYPE=" -cpu host" CPU_TYPE=""
CORE_COUNT="2" CORE_COUNT="2"
RAM_SIZE="4096" RAM_SIZE="4096"
BRG="vmbr0" BRG="vmbr0"
@ -150,9 +140,9 @@ function default_settings() {
echo -e "${DGN}Using HAOS Version: ${BGN}${BRANCH}${CL}" echo -e "${DGN}Using HAOS Version: ${BGN}${BRANCH}${CL}"
echo -e "${DGN}Using Virtual Machine ID: ${BGN}${VMID}${CL}" echo -e "${DGN}Using Virtual Machine ID: ${BGN}${VMID}${CL}"
echo -e "${DGN}Using Machine Type: ${BGN}i440fx${CL}" echo -e "${DGN}Using Machine Type: ${BGN}i440fx${CL}"
echo -e "${DGN}Using Disk Cache: ${BGN}Write Through${CL}" echo -e "${DGN}Using Disk Cache: ${BGN}Default${CL}"
echo -e "${DGN}Using Hostname: ${BGN}${HN}${CL}" echo -e "${DGN}Using Hostname: ${BGN}${HN}${CL}"
echo -e "${DGN}Using CPU Model: ${BGN}Host${CL}" echo -e "${DGN}Using CPU Model: ${BGN}Default${CL}"
echo -e "${DGN}Allocated Cores: ${BGN}${CORE_COUNT}${CL}" echo -e "${DGN}Allocated Cores: ${BGN}${CORE_COUNT}${CL}"
echo -e "${DGN}Allocated RAM: ${BGN}${RAM_SIZE}${CL}" echo -e "${DGN}Allocated RAM: ${BGN}${RAM_SIZE}${CL}"
echo -e "${DGN}Using Bridge: ${BGN}${BRG}${CL}" echo -e "${DGN}Using Bridge: ${BGN}${BRG}${CL}"
@ -209,14 +199,14 @@ function advanced_settings() {
fi fi
if DISK_CACHE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \ if DISK_CACHE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
"0" "None" OFF \ "0" "Default" ON \
"1" "Write Through (Default)" ON \ "1" "Write Through" OFF \
3>&1 1>&2 2>&3); then 3>&1 1>&2 2>&3); then
if [ $DISK_CACHE1 = "1" ]; then if [ $DISK_CACHE1 = "1" ]; then
echo -e "${DGN}Using Disk Cache: ${BGN}Write Through${CL}" echo -e "${DGN}Using Disk Cache: ${BGN}Write Through${CL}"
DISK_CACHE="cache=writethrough," DISK_CACHE="cache=writethrough,"
else else
echo -e "${DGN}Using Disk Cache: ${BGN}None${CL}" echo -e "${DGN}Using Disk Cache: ${BGN}Default${CL}"
DISK_CACHE="" DISK_CACHE=""
fi fi
else else
@ -236,14 +226,14 @@ function advanced_settings() {
fi fi
if CPU_TYPE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CPU MODEL" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \ if CPU_TYPE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CPU MODEL" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
"0" "KVM64" OFF \ "0" "KVM64 (Default)" ON \
"1" "Host (Default)" ON \ "1" "Host" OFF \
3>&1 1>&2 2>&3); then 3>&1 1>&2 2>&3); then
if [ $CPU_TYPE1 = "1" ]; then if [ $CPU_TYPE1 = "1" ]; then
echo -e "${DGN}Using CPU Model: ${BGN}Host${CL}" echo -e "${DGN}Using CPU Model: ${BGN}Host${CL}"
CPU_TYPE=" -cpu host" CPU_TYPE=" -cpu host"
else else
echo -e "${DGN}Using CPU Model: ${BGN}KVM64${CL}" echo -e "${DGN}Using CPU Model: ${BGN}Default${CL}"
CPU_TYPE="" CPU_TYPE=""
fi fi
else else
@ -350,7 +340,6 @@ function start_script() {
fi fi
} }
check_root
arch_check arch_check
pve_check pve_check
ssh_check ssh_check