forked from fdcastel/Proxmox-Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-pbs.sh
36 lines (30 loc) · 880 Bytes
/
setup-pbs.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
PBS_ENTERPRISE_SOURCES_FILE='/etc/apt/sources.list.d/pbs-enterprise.list'
#
# Check PBS version
#
proxmox-backup-manager version | grep 'proxmox-backup-server 2'
if [ $? -ne 0 ]; then
echo 'This script only works with Proxmox Backup Server 2.x.'
exit 1
fi
#
# Run-only-once check
#
FIRST_LINE=$(head -1 $PBS_ENTERPRISE_SOURCES_FILE)
if [ "$FIRST_LINE" == '# Disable pbs-enterprise' ]; then
echo 'This script must be run only once.'
exit 1
fi
#
# Remove enterprise (subscription-only) sources
#
cat > $PBS_ENTERPRISE_SOURCES_FILE <<EOF
# Disable pbs-enterprise
# deb https://enterprise.proxmox.com/debian/pbs bullseye pbs-enterprise
EOF
cat >> /etc/apt/sources.list <<EOF
# PBS pbs-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pbs bullseye pbs-no-subscription
EOF