Compare commits
2 commits
003deb6455
...
6cde243005
Author | SHA1 | Date | |
---|---|---|---|
6cde243005 | |||
358fd7d687 |
2 changed files with 44 additions and 24 deletions
|
@ -1,20 +1,28 @@
|
|||
KEY_ALGORITHM='ed25519'
|
||||
KEY_PATH=".ssh/id_ed25519"
|
||||
KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5'
|
||||
PACKAGES=(
|
||||
'python3'
|
||||
'rsync'
|
||||
'tree'
|
||||
)
|
||||
SERVER="$(basename ${GITHUB_SERVER_URL})"
|
||||
|
||||
# ssh
|
||||
|
||||
mkdir --parents ~/.ssh
|
||||
mkdir '.ssh' \
|
||||
|| exit
|
||||
|
||||
echo "${CD}" > ~/.ssh/id_ed25519
|
||||
echo "${CD}" > "${KEY_PATH}" \
|
||||
|| exit
|
||||
unset CD
|
||||
chmod 400 ~/.ssh/id_ed25519
|
||||
chmod '400' "${KEY_PATH}" \
|
||||
|| exit
|
||||
|
||||
echo -n "\
|
||||
|1|BcccCTMLpM9HHSgJmPu/FFOwOv0=|+3BKK02xibpCPxQ9Nghi2GbXLng= \
|
||||
ssh-ed25519 \
|
||||
AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5
|
||||
" > ~/.ssh/known_hosts
|
||||
echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \
|
||||
> '.ssh/known_hosts' \
|
||||
|| exit
|
||||
|
||||
# packages
|
||||
|
||||
apt-get install --yes \
|
||||
'python3' \
|
||||
'rsync' \
|
||||
'tree' \
|
||||
apt-get install --yes "${PACKAGES[@]}"
|
||||
|
|
36
cd.sh
36
cd.sh
|
@ -1,15 +1,27 @@
|
|||
echo "\
|
||||
nameserver 9.9.9.9
|
||||
" > '/etc/resolv.conf' \
|
||||
&& \
|
||||
NAMESERVERS=(
|
||||
'9.9.9.9'
|
||||
)
|
||||
PACKAGES=(
|
||||
'git'
|
||||
)
|
||||
REPOSITORY='rwx.work/cd'
|
||||
TARGET='/usr/local/sbin'
|
||||
|
||||
for nameserver in "${NAMESERVERS[@]}" ; do
|
||||
echo "nameserver ${nameserver}" \
|
||||
>> '/etc/resolv.conf' \
|
||||
|| exit
|
||||
done
|
||||
|
||||
apt-get update \
|
||||
&& \
|
||||
apt-get install \
|
||||
'git' \
|
||||
--yes \
|
||||
&& \
|
||||
|| exit
|
||||
|
||||
apt-get install --yes "${PACKAGES[@]}" \
|
||||
|| exit
|
||||
|
||||
git clone \
|
||||
"${GITHUB_SERVER_URL}/rwx.work/cd" \
|
||||
'/usr/local/sbin' \
|
||||
&& \
|
||||
"${GITHUB_SERVER_URL}/${REPOSITORY}" \
|
||||
"${TARGET}" \
|
||||
|| exit
|
||||
|
||||
cd-bootstrap.sh
|
||||
|
|
Loading…
Reference in a new issue