mirror of
https://github.com/bashclub/proxmox-zfs-postinstall.git
synced 2024-12-26 02:00:12 +01:00
Fix apt repo
This commit is contained in:
parent
eb4bc95c9a
commit
9f5c44029b
26
postinstall
26
postinstall
@ -275,27 +275,35 @@ set_pve_repo(){
|
|||||||
enterprise=$(grep pve-enterprise /etc/apt/sources.list.d/pve-enterprise.list)
|
enterprise=$(grep pve-enterprise /etc/apt/sources.list.d/pve-enterprise.list)
|
||||||
test=$(grep pvetest /etc/apt/sources.list)
|
test=$(grep pvetest /etc/apt/sources.list)
|
||||||
if [[ $repo_selection == "pve-enterprise" ]]; then
|
if [[ $repo_selection == "pve-enterprise" ]]; then
|
||||||
pvesh set nodes/px1/apt/repositories --handle enterprise
|
echo "deb https://enterprise.proxmox.com/debian/pve $VERSION_CODENAME pve-enterprise" > /etc/apt/sources.list.d/pve-enterprise.list
|
||||||
if [[ $nosub != "" ]]; then
|
if [[ $nosub != "" ]] && [[ $nosub != *"#"* ]]; then
|
||||||
sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
|
sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
|
||||||
fi
|
fi
|
||||||
if [[ $test != "" ]]; then
|
if [[ $test != "" ]] && [[ $test != *"#"* ]]; then
|
||||||
sed -i "s|$test|# $test|g" /etc/apt/sources.list
|
sed -i "s|$test|# $test|g" /etc/apt/sources.list
|
||||||
fi
|
fi
|
||||||
elif [[ $repo_selection == "pve-no-subscription" ]]; then
|
elif [[ $repo_selection == "pve-no-subscription" ]]; then
|
||||||
pvesh set nodes/px1/apt/repositories --handle no-subscription
|
if [[ $nosub == "" ]]; then
|
||||||
if [[ $enterprise != "" ]]; then
|
echo -e "\ndeb http://download.proxmox.com/debian/pve $VERSION_CODENAME pve-no-subscription\n" >> /etc/apt/sources.list
|
||||||
|
elif [[ $nosub == *"#"* ]]; then
|
||||||
|
sed -i "s|$nosub|$(echo $nosub | cut -d' ' -f2-)|" /etc/apt/sources.list
|
||||||
|
fi
|
||||||
|
if [[ $enterprise != "" ]] && [[ $enterprise != *"#"* ]]; then
|
||||||
sed -i "s|$enterprise|# $enterprise|g" /etc/apt/sources.list.d/pve-enterprise.list
|
sed -i "s|$enterprise|# $enterprise|g" /etc/apt/sources.list.d/pve-enterprise.list
|
||||||
fi
|
fi
|
||||||
if [[ $test != "" ]]; then
|
if [[ $test != "" ]] && [[ $test != *"#"* ]]; then
|
||||||
sed -i "s|$test|# $test|g" /etc/apt/sources.list
|
sed -i "s|$test|# $test|g" /etc/apt/sources.list
|
||||||
fi
|
fi
|
||||||
elif [[ $repo_selection == "pvetest" ]]; then
|
elif [[ $repo_selection == "pvetest" ]]; then
|
||||||
pvesh set nodes/px1/apt/repositories --handle test
|
if [[ $test == "" ]]; then
|
||||||
if [[ $nosub != "" ]]; then
|
echo -e "\ndeb http://download.proxmox.com/debian/pve $VERSION_CODENAME pvetest\n" >> /etc/apt/sources.list
|
||||||
|
elif [[ $test == *"#"* ]]; then
|
||||||
|
sed -i "s|$test|$(echo $test | cut -d' ' -f2-)|" /etc/apt/sources.list
|
||||||
|
fi
|
||||||
|
if [[ $nosub != "" ]] && [[ $nosub != *"#"* ]]; then
|
||||||
sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
|
sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
|
||||||
fi
|
fi
|
||||||
if [[ $enterprise != "" ]]; then
|
if [[ $enterprise != "" ]] && [[ $enterprise != *"#"* ]]; then
|
||||||
sed -i "s|$enterprise|# $enterprise|g" /etc/apt/sources.list.d/pve-enterprise.list
|
sed -i "s|$enterprise|# $enterprise|g" /etc/apt/sources.list.d/pve-enterprise.list
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user