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