From aaa73f75c85bed9f467ae1a47f8db44f33b76e18 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 21:29:06 +0200 Subject: [PATCH] ssh --- bootstrap.sh | 9 --------- cd.sh | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index e6a0466..2e038fd 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -7,11 +7,6 @@ KEY_ALGORITHM='ed25519' KEY_DIRECTORY='.ssh' KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}" KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5' -PACKAGES=( -'openssh-client' -'rsync' -'tree' -) SERVER="$(basename ${GITHUB_SERVER_URL})" TARGET='/usr/local/sbin' @@ -36,7 +31,3 @@ chmod '400' "${KEY_PATH}" \ echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \ > "${KEY_DIRECTORY}/known_hosts" \ || exit - -# packages -apt-get install --yes "${PACKAGES[@]}" \ -|| exit diff --git a/cd.sh b/cd.sh index 25a6488..9c9639c 100644 --- a/cd.sh +++ b/cd.sh @@ -31,6 +31,8 @@ cd_main () { cd_install_python # TODO move to Python cd_install_rsync + # TODO move to Python + cd_install_ssh cd_clean_packages_cache cd_install_python_modules ${CD_PYTHON_MODULES} cd_execute_python_module ${CD_PYTHON_MODULES} @@ -353,6 +355,13 @@ Dir::Etc::SourceParts \"\"; "CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH" cd_split cd_echo "CD_PROJECTS_URL" "CD_PROJECT_URL" + # TODO move to Python + case "${CD_PM}" in + "${CD_PM_APK}"|"${CD_PM_APT}") CD_PKG_SSH="openssh-client" ;; + "${CD_PM_DNF}") CD_PKG_SSH="openssh-clients" ;; + "${CD_PM_PACMAN}") CD_PKG_SSH="openssh" ;; + ;; + esac } cd_set_packages_repositories () { @@ -512,6 +521,12 @@ cd_install_rsync () { cd_install_package "${CD_PKG_RSYNC}" } +# TODO move to Python +cd_install_ssh () { + cd_step "Install SSH" + cd_install_package "${CD_PKG_SSH}" +} + cd_clean_packages_cache () { cd_step "Clean packages cache" ${CD_PM_CLEAN} || exit