diff --git a/cd.sh b/cd.sh index bfe12fe..82b9beb 100644 --- a/cd.sh +++ b/cd.sh @@ -159,14 +159,45 @@ Dir::Etc::SourceParts \"\"; cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific case "${CD_OS_ID}" in - "${CD_OS_ALMA}") CD_PM_URL="https://repo.almalinux.org/almalinux" ;; - "${CD_OS_ALPINE}") CD_PM_URL="https://dl-cdn.alpinelinux.org/alpine" ;; - "${CD_OS_DEBIAN}") CD_PM_URL="http://deb.debian.org/debian" ;; - "${CD_OS_ROCKY}") CD_PM_URL="http://dl.rockylinux.org/\$contentdir" ;; - "${CD_OS_UBUNTU}") CD_PM_URL="http://archive.ubuntu.com/ubuntu" ;; + "${CD_OS_ALMA}") + CD_URL_DEFAULT="https://repo.almalinux.org/almalinux" + ;; + "${CD_OS_ALPINE}") + CD_URL_DEFAULT="https://dl-cdn.alpinelinux.org/alpine" + ;; + "${CD_OS_DEBIAN}") + CD_URL_DEFAULT="http://deb.debian.org/debian" + ;; + "${CD_OS_ROCKY}") + CD_URL_DEFAULT="http://dl.rockylinux.org/\$contentdir" + ;; + "${CD_OS_UBUNTU}") + CD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" + ;; + esac + CD_URL_CHOSEN="${CD_URL_DEFAULT}" + case "${CD_OS_ID}" in + "${CD_OS_ALMA}") + [ "${CD_URL_ALMA}" ] && CD_URL_CHOSEN="${CD_URL_ALMA}" + ;; + "${CD_OS_ALPINE}") + [ "${CD_URL_ALPINE}" ] && CD_URL_CHOSEN="${CD_URL_ALPINE}" + ;; + "${CD_OS_DEBIAN}") + [ "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \ + || CD_URL_CHOSEN="https://deb.debian.org/debian" + ;; + "${CD_OS_ROCKY}") + [ "${CD_URL_ROCKY}" ] && CD_URL_CHOSEN="${CD_URL_ROCKY}" \ + || CD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" + ;; + "${CD_OS_UBUNTU}") + [ "${CD_URL_UBUNTU}" ] && CD_URL_CHOSEN="${CD_URL_UBUNTU}" \ + || CD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" + ;; esac cd_split - cd_echo "CD_PM_URL" + cd_echo "CD_URL_DEFAULT" "CD_URL_CHOSEN" # TODO python case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -193,20 +224,14 @@ Dir::Etc::SourceParts \"\"; # TODO case "${CD_OS_ID}" in "${CD_OS_ALMA}") - CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" - [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" CD_PKG_PKG="" ;; "${CD_OS_ALPINE}") - CD_OS_REPO="${CD_DEFAULT_REPO_ALPINE}" - [ "${CD_REPO_ALPINE}" ] && CD_OS_REPO="${CD_REPO_ALPINE}" CD_PKG_PKG="" ;; "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" # - CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" - [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" CD_PKG_PKG="apt-utils" ;; esac diff --git a/readme.md b/readme.md index 5123f2b..4a7980e 100644 --- a/readme.md +++ b/readme.md @@ -11,10 +11,20 @@ from various CA, CI, OCI / OS. * [X] known CA certificates * [ ] Operating Systems * [X] Alma + * [X] 9 + * [X] 8 * [X] Alpine + * [X] 3.19 + * [X] 3.18 * [X] Debian + * [X] Bookworm + * [X] Bullseye * [ ] Rocky + * [ ] 9 + * [ ] 8 * [ ] Ubuntu + * [ ] Noble + * [ ] Mantic * [ ] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo * [X] GitLab @@ -22,15 +32,15 @@ from various CA, CI, OCI / OS. ## How -| Variable | Description | -|:---------------|:------------------------| -| CD_CA_n | Numbered CA certificate | -| CD_DNS | Space separated servers | -| CD_REPO_ALMA | Alma repository URL | -| CD_REPO_ALPINE | Alpine repository URL | -| CD_REPO_DEBIAN | Debian repository URL | -| CD_REPO_ROCKY | Rocky repository URL | -| CD_REPO_UBUNTU | Ubuntu repository URL | +| Variable | Description | +|:--------------|:------------------------| +| CD_CA_n | Numbered CA certificate | +| CD_DNS | Space separated servers | +| CD_URL_ALMA | Alma repository URL | +| CD_URL_ALPINE | Alpine repository URL | +| CD_URL_DEBIAN | Debian repository URL | +| CD_URL_ROCKY | Rocky repository URL | +| CD_URL_UBUNTU | Ubuntu repository URL | ## Tasks