-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux_manage_proxmox_repo_community.sh
More file actions
executable file
·60 lines (52 loc) · 1.61 KB
/
linux_manage_proxmox_repo_community.sh
File metadata and controls
executable file
·60 lines (52 loc) · 1.61 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
#
# Switch Repo to Community [Proxmox]
#
# Supports:
# Proxmox
#
# Category:
# Repo
#
# License:
# AGPLv3
#
# Author:
# Charlie Powell <cdp1337@bitsnbytes.dev>
#
# Link:
# https://github.com/eVAL-Agency/ScriptsCollection
#
# Changelog:
# 20250502 - Initial version
DISTRO="$(egrep '^VERSION_CODENAME' /etc/os-release | awk -F '=' '{print $2}')"
# Disable enterprise repos first
if [ -e "/etc/apt/sources.list.d/pve-enterprise.list" ]; then
echo "Disabling pve-enterprise.list"
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.disabled
fi
if [ -e "/etc/apt/sources.list.d/ceph.list" ]; then
echo "Disabling ceph.list"
mv /etc/apt/sources.list.d/ceph.list /etc/apt/sources.list.d/ceph-enterprise.disabled
fi
# Enable community repos
if [ -e "/etc/apt/sources.list.d/pve-community.disabled" ]; then
echo "Enabling pve-community.list"
mv /etc/apt/sources.list.d/pve-community.disabled /etc/apt/sources.list.d/pve-community.list
else
echo "Creating pve-community.list"
echo "deb http://download.proxmox.com/debian/pve $DISTRO pve-no-subscription" > /etc/apt/sources.list.d/pve-community.list
fi
if [ -e "/etc/apt/sources.list.d/ceph-community.disabled" ]; then
echo "Enabling ceph-community.list"
mv /etc/apt/sources.list.d/ceph-community.disabled /etc/apt/sources.list.d/ceph-community.list
else
echo "Creating ceph-community.list"
echo "deb http://download.proxmox.com/debian/ceph-quincy $DISTRO no-subscription" > /etc/apt/sources.list.d/ceph-community.list
fi
# Update repos
apt update
if [ $? -ne 0 ]; then
echo "Failed to update apt repositories" >&2
exit 1
fi