From 0c10c4f4ef962241e8d7dd15d718c97f8e47ebe6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 26 Apr 2024 13:38:38 +0200 Subject: [PATCH] veriables --- cd.sh | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index c362a84..618fc4d 100644 --- a/cd.sh +++ b/cd.sh @@ -1,14 +1,33 @@ -NAMESERVERS=( +CD_DNS_SERVERS=( '9.9.9.9' ) -REPOSITORY='rwx.work/cd' +CD_REPOSITORY='rwx.work/cd' + +CD_DNS_FILE='/etc/resolv.conf' +case "${CD_OS_NAME}" in + 'debian') + case "${CD_OS_VERSION}" in + 'bookworm') + echo 'bookworm!' + ;; + *) + echo 'CD_OS_VERSION' + exit 2 + ;; + esac + ;; + *) + echo 'CD_OS_NAME' + exit 1 + ;; +esac echo " 1/14 set name servers " -for nameserver in "${NAMESERVERS[@]}" ; do - echo "nameserver ${nameserver}" \ - >> '/etc/resolv.conf' \ +for server in "${CD_DNS_SERVERS[@]}" ; do + echo "nameserver ${server}" \ + >> "${CD_DNS_FILE}" \ || exit done @@ -80,7 +99,7 @@ echo " 11/14 clone Continuous Delivery " git clone \ -"${GITHUB_SERVER_URL}/${REPOSITORY}" \ +"${GITHUB_SERVER_URL}/${CD_REPOSITORY}" \ "${DIRECTORY}" \ || exit