mirror of https://github.com/tteck/Proxmox.git
add PVE check
This commit is contained in:
parent
ab4ab4d8c5
commit
a4d6fee95f
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo -e "Loading..."
|
echo -e "Loading..."
|
||||||
|
PVE=$(pveversion | grep "pve-manager/7" | wc -l)
|
||||||
GEN_MAC=$(echo '00 60 2f'$(od -An -N3 -t xC /dev/urandom) | sed -e 's/ /:/g' | tr '[:lower:]' '[:upper:]')
|
GEN_MAC=$(echo '00 60 2f'$(od -An -N3 -t xC /dev/urandom) | sed -e 's/ /:/g' | tr '[:lower:]' '[:upper:]')
|
||||||
NEXTID=$(pvesh get /cluster/nextid)
|
NEXTID=$(pvesh get /cluster/nextid)
|
||||||
RELEASE=$(curl -sX GET "https://api.github.com/repos/home-assistant/operating-system/releases" | awk '/tag_name/{print $4;exit}' FS='[""]')
|
RELEASE=$(curl -sX GET "https://api.github.com/repos/home-assistant/operating-system/releases" | awk '/tag_name/{print $4;exit}' FS='[""]')
|
||||||
|
@ -50,6 +51,13 @@ function cleanup() {
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
pushd $TEMP_DIR >/dev/null
|
pushd $TEMP_DIR >/dev/null
|
||||||
|
|
||||||
|
if [[ "$PVE" != "1" ]]; then
|
||||||
|
echo -e "${RD}This script requires Proxmox Virtual Environment 7.0 or greater${CL}"
|
||||||
|
echo -e "Exiting..."
|
||||||
|
sleep 2
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
clear
|
||||||
read -p "This will create a New Home Assistant OS VM. Proceed(y/n)?" yn
|
read -p "This will create a New Home Assistant OS VM. Proceed(y/n)?" yn
|
||||||
|
|
Loading…
Reference in New Issue