28 lines
467 B
Bash
Executable file
28 lines
467 B
Bash
Executable file
KEY_ALGORITHM='ed25519'
|
|
KEY_PATH=".ssh/id_ed25519"
|
|
KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5'
|
|
PACKAGES=(
|
|
'python3'
|
|
'rsync'
|
|
'tree'
|
|
)
|
|
SERVER="$(basename ${GITHUB_SERVER_URL})"
|
|
|
|
# ssh
|
|
|
|
mkdir '.ssh' \
|
|
|| exit
|
|
|
|
echo "${CD}" > "${KEY_PATH}" \
|
|
|| exit
|
|
unset CD
|
|
chmod '400' "${KEY_PATH}" \
|
|
|| exit
|
|
|
|
echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \
|
|
> '.ssh/known_hosts' \
|
|
|| exit
|
|
|
|
# packages
|
|
|
|
apt-get install --yes "${PACKAGES[@]}"
|