71 lines
1.1 KiB
Bash
71 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
function main() {
|
|
RELEASE="$(lsb_release -cs)"
|
|
apt update
|
|
prov-$RELEASE
|
|
}
|
|
|
|
function detect-mirror-country() {
|
|
apt install -y jq curl
|
|
curl ipinfo.io | jq -r .country
|
|
}
|
|
|
|
function set-mirror-country() {
|
|
MURM="main universe restricted multiverse"
|
|
COUNTRY="$(detect-mirror-country)"
|
|
URL="http://$COUNTRY.archive.ubuntu.com/ubuntu"
|
|
cat > /etc/apt/sources.list.new <<EOF
|
|
deb $URL $(lsb_release -cs) $MURM
|
|
deb $URL $(lsb_release -cs)-updates $MURM
|
|
deb $URL $(lsb_release -cs)-backports $MURM
|
|
deb $URL $(lsb_release -cs)-security $MURM
|
|
EOF
|
|
|
|
}
|
|
|
|
function prov-focal() {
|
|
|
|
set-mirror-country
|
|
|
|
PKGS="
|
|
bridge-utils
|
|
byobu
|
|
git
|
|
golang-go
|
|
magic-wormhole
|
|
make
|
|
net-tools
|
|
nmap
|
|
ntp
|
|
pbzip2
|
|
pv
|
|
traceroute
|
|
unzip
|
|
vim
|
|
vlan
|
|
wireguard-tools
|
|
zip
|
|
zsh
|
|
zstd
|
|
"
|
|
apt update && \
|
|
apt upgrade -y && \
|
|
apt install -y $PKGS && \
|
|
apt autoremove -y
|
|
install-age
|
|
}
|
|
|
|
function install-age () {
|
|
cd /tmp
|
|
git clone https://filippo.io/age && cd age
|
|
go build -o . filippo.io/age/cmd/...
|
|
mv ./age /usr/local/bin
|
|
cd -
|
|
rm -rf /tmp/age
|
|
}
|
|
|
|
main
|