From 62036d62c2ee3b10d93a2c401ed636623c5ba869 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 26 Apr 2024 15:38:22 +0200 Subject: [PATCH 1/4] fixes --- cd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 819404e..ec6cf1a 100644 --- a/cd.sh +++ b/cd.sh @@ -1,3 +1,5 @@ +#! /usr/bin/env bash + CD_DNS_SERVERS=( '9.9.9.9' ) @@ -25,7 +27,7 @@ CD_STEP=0 function cd_step { if [ "${1}" ] ; then - CD_STEP=$((CD_STEP+1)) + ((CD_STEP++)) echo " ↕ ${CD_STEP} ↔ ${1} " From 30eb5cc29723c40e982e7b87e7eac27da2fe6f6f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 26 Apr 2024 15:54:37 +0200 Subject: [PATCH 2/4] pkgconf --- cd.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index ec6cf1a..b3332ed 100644 --- a/cd.sh +++ b/cd.sh @@ -44,7 +44,7 @@ local text="${2}" fi } -function cd_set_dns { +function cd_set_dns_resolving { local server local text='' cd_step "set name servers" @@ -56,18 +56,26 @@ local text='' || exit } -function cd_main { - cd_set_dns - -cd_step "configure package manager" -echo -n "\ +function cd_set_packages_configuration { + cd_step "configure package manager" + case "${CD_OS_NAME}" in + 'debian') + cd_write '/etc/apt/apt.conf.d/apt.conf' "\ Acquire::Check-Valid-Until True; APT::Get::Show-Versions True; APT::Install-Recommends False; APT::Install-Suggests False; Dir::Etc::SourceParts ''; -" > '/etc/apt/apt.conf.d/apt.conf' \ -|| exit +" + ;; + *) exit ;; + esac +} + +function cd_main { + cd_set_dns_resolving + cd_set_packages_configuration + cd_step "configure package repositories" echo -n "\ deb https://deb.debian.org/debian bookworm main From ffb21653830f7ae19d25d737ab0cbf0f4508c11b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 26 Apr 2024 15:57:23 +0200 Subject: [PATCH 3/4] exit --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index b3332ed..9ed590c 100644 --- a/cd.sh +++ b/cd.sh @@ -68,7 +68,7 @@ APT::Install-Suggests False; Dir::Etc::SourceParts ''; " ;; - *) exit ;; + *) exit 1 ;; esac } From 62cd874c26701767622d7cd87358c765ebfb981a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 26 Apr 2024 16:03:17 +0200 Subject: [PATCH 4/4] sourceparts --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 9ed590c..5f799d4 100644 --- a/cd.sh +++ b/cd.sh @@ -65,7 +65,7 @@ Acquire::Check-Valid-Until True; APT::Get::Show-Versions True; APT::Install-Recommends False; APT::Install-Suggests False; -Dir::Etc::SourceParts ''; +Dir::Etc::SourceParts \"\"; " ;; *) exit 1 ;;