diff --git a/cd-bootstrap.sh b/cd-bootstrap.sh index 3fc156a..dbab7b6 100755 --- a/cd-bootstrap.sh +++ b/cd-bootstrap.sh @@ -1,5 +1,6 @@ KEY_ALGORITHM='ed25519' -KEY_PATH=".ssh/id_${KEY_ALGORITHM}" +KEY_DIRECTORY='.ssh' +KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}" KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5' PACKAGES=( 'python3' @@ -9,8 +10,9 @@ PACKAGES=( SERVER="$(basename ${GITHUB_SERVER_URL})" # ssh -cd -mkdir '.ssh' \ +cd \ +|| exit +mkdir "${KEY_DIRECTORY}" \ || exit echo "${CD}" > "${KEY_PATH}" \ || exit @@ -18,7 +20,7 @@ unset CD chmod '400' "${KEY_PATH}" \ || exit echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \ -> '.ssh/known_hosts' \ +> "${KEY_DIRECTORY}/known_hosts" \ || exit # packages