spcd/cd.sh
2024-04-25 10:23:23 +02:00

34 lines
595 B
Bash

NAMESERVERS=(
'9.9.9.9'
)
PACKAGES=(
'ca-certificates'
'git'
'python3'
)
REPOSITORY='rwx.work/cd'
for nameserver in "${NAMESERVERS[@]}" ; do
echo "nameserver ${nameserver}" \
>> '/etc/resolv.conf' \
|| exit
done
echo -n "\
APT::Get::Show-Versions True;
APT::Install-Recommends False;
APT::Install-Suggests False;
" > '/etc/apt/apt.conf.d/apt.conf' \
|| exit
apt-get update \
|| exit
apt-get install --yes "${PACKAGES[@]}" \
|| exit
DIRECTORY="$(mktemp --directory)" \
|| exit
git clone \
"${GITHUB_SERVER_URL}/${REPOSITORY}" \
"${DIRECTORY}" \
|| exit
"${DIRECTORY}/bootstrap.sh"