mirror of
				https://github.com/bashclub/proxmox-zfs-postinstall.git
				synced 2025-11-04 08:32:28 +01:00 
			
		
		
		
	Fix repo edit
This commit is contained in:
		
							
								
								
									
										14
									
								
								postinstall
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								postinstall
									
									
									
									
									
								
							@@ -264,7 +264,7 @@ set_locales(){
 | 
				
			|||||||
    for locale in $locales; do
 | 
					    for locale in $locales; do
 | 
				
			||||||
        line=$(grep $locale /etc/locale.gen)
 | 
					        line=$(grep $locale /etc/locale.gen)
 | 
				
			||||||
        if echo $line | grep "#" ; then
 | 
					        if echo $line | grep "#" ; then
 | 
				
			||||||
            sed -i "s/$line/$(echo $line | cut -d' ' -f2-)" /etc/locale.gen
 | 
					            sed -i "s/$line/$(echo $line | cut -d' ' -f2-)/" /etc/locale.gen
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    done
 | 
					    done
 | 
				
			||||||
    locale-gen
 | 
					    locale-gen
 | 
				
			||||||
@@ -276,17 +276,29 @@ set_pve_repo(){
 | 
				
			|||||||
    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
 | 
					        pvesh set nodes/px1/apt/repositories --handle enterprise
 | 
				
			||||||
 | 
					        if [[ $nosub != "" ]]; then
 | 
				
			||||||
            sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
 | 
					            sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					        if [[ $test != "" ]]; then
 | 
				
			||||||
            sed -i "s|$test|# $test|g" /etc/apt/sources.list
 | 
					            sed -i "s|$test|# $test|g" /etc/apt/sources.list
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
    elif [[ $repo_selection == "pve-no-subscription" ]]; then
 | 
					    elif [[ $repo_selection == "pve-no-subscription" ]]; then
 | 
				
			||||||
        pvesh set nodes/px1/apt/repositories --handle no-subscription
 | 
					        pvesh set nodes/px1/apt/repositories --handle no-subscription
 | 
				
			||||||
 | 
					        if [[ $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
 | 
				
			||||||
 | 
					        if [[ $test != "" ]]; then
 | 
				
			||||||
            sed -i "s|$test|# $test|g" /etc/apt/sources.list
 | 
					            sed -i "s|$test|# $test|g" /etc/apt/sources.list
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
    elif [[ $repo_selection == "pvetest" ]]; then
 | 
					    elif [[ $repo_selection == "pvetest" ]]; then
 | 
				
			||||||
        pvesh set nodes/px1/apt/repositories --handle test
 | 
					        pvesh set nodes/px1/apt/repositories --handle test
 | 
				
			||||||
 | 
					        if [[ $nosub != "" ]]; then
 | 
				
			||||||
            sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
 | 
					            sed -i "s|$nosub|# $nosub|g" /etc/apt/sources.list
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					        if [[ $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
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
update_system(){
 | 
					update_system(){
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user