From 5ff98571f938315ca665b923fc363fe234421fd3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 15 Nov 2024 19:24:48 +0100 Subject: [PATCH] apt_conf_write --- shell/debian.sh | 14 ++++++++++++++ shell/rescue/common.sh | 12 +----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/shell/debian.sh b/shell/debian.sh index e4085df..f806ba6 100644 --- a/shell/debian.sh +++ b/shell/debian.sh @@ -8,6 +8,20 @@ apt_clean() { clean } +apt_conf_write() { + printf "\ +Acquire::AllowInsecureRepositories False; +Acquire::AllowWeakRepositories False; +Acquire::AllowDowngradeToInsecureRepositories False; +Acquire::Check-Valid-Until True; +APT::Install-Recommends False; +APT::Install-Suggests False; +APT::Get::Show-Versions True; +Dir::Etc::SourceParts \"\"; +Dpkg::Progress True; +" >"/etc/apt/apt.conf.d/apt.conf" +} + apt_install_backports() { apt_install_target "${DEBIAN_CODENAME}-backports" "${@}" } diff --git a/shell/rescue/common.sh b/shell/rescue/common.sh index 306f7fa..49a9305 100644 --- a/shell/rescue/common.sh +++ b/shell/rescue/common.sh @@ -1,17 +1,7 @@ rescue_configure() { local hostname="${1}" # apt / conf - printf "\ -Acquire::AllowInsecureRepositories False; -Acquire::AllowWeakRepositories False; -Acquire::AllowDowngradeToInsecureRepositories False; -Acquire::Check-Valid-Until True; -APT::Install-Recommends False; -APT::Install-Suggests False; -APT::Get::Show-Versions True; -Dir::Etc::SourceParts \"\"; -Dpkg::Progress True; -" >"/etc/apt/apt.conf.d/apt.conf" + apt_conf_write # apt / sources apt_sources_write # bash / rc