mirror of
https://github.com/bashclub/proxmox-zfs-postinstall.git
synced 2024-11-08 02:31:58 +01:00
Add subscription check
This commit is contained in:
parent
3564f2fe32
commit
d2f7d88910
@ -148,6 +148,38 @@ auto_snapshot(){
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_subscription(){
|
||||||
|
serverid=$(pvesh get nodes/px1/subscription --output-format yaml | grep serverid | cut -d' ' -f2)
|
||||||
|
sub_status=$(pvesh get nodes/px1/subscription --output-format yaml | grep status | cut -d' ' -f2)
|
||||||
|
if [[ $sub_status == "notfound" ]]; then
|
||||||
|
if [[ $repo_selection == "pve-enterprise" ]]; then
|
||||||
|
if whiptail --title "NO PROXMOX SUBSCRIPTION FOUND" \
|
||||||
|
--backtitle $PROG \
|
||||||
|
--yes-button "ADD" \
|
||||||
|
--no-button "SKIP" \
|
||||||
|
--yesno "Server ID: $serverid\nDo you want to add a subscription key?" 17 76 ; then
|
||||||
|
add_subscription
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if whiptail --title "NO PROXMOX SUBSCRIPTION FOUND" \
|
||||||
|
--backtitle $PROG \
|
||||||
|
--yes-button "SUPPRESS WARNING" \
|
||||||
|
--no-button "SKIP" \
|
||||||
|
--yesno "Do you want to suppress the no subscription warning in WebGUI?" 17 76 ; then
|
||||||
|
suppress_no_subscription_warning
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_subscription(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
suppress_no_subscription_warning(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
select_pve_repos(){
|
select_pve_repos(){
|
||||||
pveenterprise=OFF
|
pveenterprise=OFF
|
||||||
pvenosubscription=OFF
|
pvenosubscription=OFF
|
||||||
@ -166,11 +198,13 @@ select_pve_repos() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
whiptail --title "SELECT PVE REPOSITORY" --backtitle "$PROG" \
|
fi
|
||||||
|
repo_selection=$(whiptail --title "SELECT PVE REPOSITORY" --backtitle "$PROG" \
|
||||||
--radiolist "Choose Proxmox VE repository" 20 76 4 \
|
--radiolist "Choose Proxmox VE repository" 20 76 4 \
|
||||||
"pve-enterprise" "Proxmox VE Enterprise repository" "$pveenterprise" \
|
"pve-enterprise" "Proxmox VE Enterprise repository" "$pveenterprise" \
|
||||||
"pve-no-subscription" "Proxmox VE No Subscription repository" "$pvenosubscription" \
|
"pve-no-subscription" "Proxmox VE No Subscription repository" "$pvenosubscription" \
|
||||||
"pvetest" "Proxmox VE Testing repository" "$pvetest"
|
"pvetest" "Proxmox VE Testing repository" "$pvetest" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,3 +221,6 @@ auto_snapshot
|
|||||||
|
|
||||||
# Select proxmox repository
|
# Select proxmox repository
|
||||||
select_pve_repos
|
select_pve_repos
|
||||||
|
|
||||||
|
# subscription related actions
|
||||||
|
select_subscription
|
Loading…
Reference in New Issue
Block a user