Compare commits
7 commits
8dc81682b4
...
a21a21be9a
Author | SHA1 | Date | |
---|---|---|---|
a21a21be9a | |||
0b55a80d97 | |||
e40ae2dba2 | |||
6cde243005 | |||
358fd7d687 | |||
003deb6455 | |||
e0839547da |
4 changed files with 54 additions and 25 deletions
5
cd
5
cd
|
@ -1,5 +0,0 @@
|
|||
echo 'nameserver 9.9.9.9' > '/etc/resolv.conf' \
|
||||
&& apt-get update \
|
||||
&& apt-get install --yes 'git' \
|
||||
&& git clone "${GITHUB_SERVER_URL}/rwx.work/cd" '/usr/local/sbin' \
|
||||
&& cd-bootstrap
|
20
cd-bootstrap
20
cd-bootstrap
|
@ -1,20 +0,0 @@
|
|||
# ssh
|
||||
|
||||
mkdir --parents ~/.ssh
|
||||
|
||||
echo "${CD}" > ~/.ssh/id_ed25519
|
||||
unset CD
|
||||
chmod 400 ~/.ssh/id_ed25519
|
||||
|
||||
echo -n "\
|
||||
|1|BcccCTMLpM9HHSgJmPu/FFOwOv0=|+3BKK02xibpCPxQ9Nghi2GbXLng= \
|
||||
ssh-ed25519 \
|
||||
AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5
|
||||
" > ~/.ssh/known_hosts
|
||||
|
||||
# packages
|
||||
|
||||
apt-get install --yes \
|
||||
'python3' \
|
||||
'rsync' \
|
||||
'tree' \
|
27
cd-bootstrap.sh
Executable file
27
cd-bootstrap.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
KEY_ALGORITHM='ed25519'
|
||||
KEY_DIRECTORY='.ssh'
|
||||
KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}"
|
||||
KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5'
|
||||
PACKAGES=(
|
||||
'python3'
|
||||
'rsync'
|
||||
'tree'
|
||||
)
|
||||
SERVER="$(basename ${GITHUB_SERVER_URL})"
|
||||
|
||||
# ssh
|
||||
cd \
|
||||
|| exit
|
||||
mkdir "${KEY_DIRECTORY}" \
|
||||
|| exit
|
||||
echo "${CD}" > "${KEY_PATH}" \
|
||||
|| exit
|
||||
unset CD
|
||||
chmod '400' "${KEY_PATH}" \
|
||||
|| exit
|
||||
echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \
|
||||
> "${KEY_DIRECTORY}/known_hosts" \
|
||||
|| exit
|
||||
|
||||
# packages
|
||||
apt-get install --yes "${PACKAGES[@]}"
|
27
cd.sh
Normal file
27
cd.sh
Normal file
|
@ -0,0 +1,27 @@
|
|||
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 \
|
||||
|| exit
|
||||
|
||||
apt-get install --yes "${PACKAGES[@]}" \
|
||||
|| exit
|
||||
|
||||
git clone \
|
||||
"${GITHUB_SERVER_URL}/${REPOSITORY}" \
|
||||
"${TARGET}" \
|
||||
|| exit
|
||||
|
||||
cd-bootstrap.sh
|
Loading…
Reference in a new issue