Compare commits
No commits in common. "a21a21be9a2155cdf565febb5df2a82f5211c62e" and "8dc81682b4740e6be6dcf0ef52f8e874e926ddfd" have entirely different histories.
a21a21be9a
...
8dc81682b4
4 changed files with 25 additions and 54 deletions
5
cd
Normal file
5
cd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
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
Executable file
20
cd-bootstrap
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
# 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' \
|
|
@ -1,27 +0,0 @@
|
||||||
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
27
cd.sh
|
@ -1,27 +0,0 @@
|
||||||
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…
Add table
Reference in a new issue