From 81b7a17351fe84d7d4b2aefcf4d129a28c10055e Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Wed, 2 Aug 2023 12:08:34 -0400 Subject: [PATCH] consolidate ubuntu install commands --- scripts/install-ubuntu.bash | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/install-ubuntu.bash diff --git a/scripts/install-ubuntu.bash b/scripts/install-ubuntu.bash new file mode 100755 index 00000000..03bc9289 --- /dev/null +++ b/scripts/install-ubuntu.bash @@ -0,0 +1,35 @@ +set -euxo pipefail + +source /etc/os-release +[[ -n ${UBUNTU_CODENAME:-} ]] || { + echo "Unable to determine Ubuntu version" >&2 + exit 1 +} + +case ${UBUNTU_CODENAME} in + jammy|focal|bionic) + UBUNTU_LTS=${UBUNTU_CODENAME} + ;; + lunar|kinetic) + UBUNTU_LTS=jammy + ;; + impish|hirsute|groovy) + UBUNTU_LTS=focal + ;; + eoan|disco|cosmic) + UBUNTU_LTS=bionic + ;; + *) + echo "Unsupported Ubuntu version: ${UBUNTU_CODENAME}" >&2 + exit 1 + ;; +esac + +curl -sSLf https://get.openziti.io/tun/package-repos.gpg \ + | sudo gpg --dearmor --output /usr/share/keyrings/openziti.gpg + +echo "deb [signed-by=/usr/share/keyrings/openziti.gpg] https://packages.openziti.org/zitipax-openziti-deb-stable ${UBUNTU_LTS} main" \ + | sudo tee /etc/apt/sources.list.d/openziti.list >/dev/null + +sudo apt update +sudo apt install -y ziti-edge-tunnel