forked from fdcastel/Proxmox-Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-pve.sh
36 lines (30 loc) · 839 Bytes
/
setup-pve.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
PVE_ENTERPRISE_SOURCES_FILE='/etc/apt/sources.list.d/pve-enterprise.list'
#
# Check PVE version
#
pveversion | grep 'pve-manager/7'
if [ $? -ne 0 ]; then
echo 'This script only works with Proxmox VE 7.x.'
exit 1
fi
#
# Run-only-once check
#
FIRST_LINE=$(head -1 $PVE_ENTERPRISE_SOURCES_FILE)
if [ "$FIRST_LINE" == '# Disable pve-enterprise' ]; then
echo 'This script must be run only once.'
exit 1
fi
#
# Remove enterprise (subscription-only) sources
#
cat > $PVE_ENTERPRISE_SOURCES_FILE <<EOF
# Disable pve-enterprise
# deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise
EOF
cat >> /etc/apt/sources.list <<EOF
# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
EOF