#!/bin/bash export DEBIAN_FRONTEND=noninteractive function main() { RELEASE="$(lsb_release -cs)" apt update prov-$RELEASE } function install-jq { if which jq >/dev/null 2>&1 ; then return fi apt install -y jq } function install-curl { if which curl >/dev/null 2>&1 ; then return fi apt install -y curl } function detect-mirror-country() { install-jq install-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 </dev/null 2>&1 ; then return fi 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