Add install traefik script

main
Buddy Sandidge 4 years ago
parent f76aee15b3
commit 3c6ab09dc1

@ -64,7 +64,7 @@ extract_tarball () {
fi fi
$sudo mkdir -p "${dest}" $sudo mkdir -p "${dest}"
tmp_dir="$(mktemp --directory)" tmp_dir="$(mktemp -d)"
tarball=${tmp_dir}/release.tar.gz tarball=${tmp_dir}/release.tar.gz
curl --silent --location --output "${tarball}" "${url}" curl --silent --location --output "${tarball}" "${url}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
APP=traefik
VERSION=${VERSION:-2.4.8}
DEST="${XDG_DATA_HOME}/apps/releases/${APP}"
URL=https://github.com/traefik/traefik/releases/download/v${VERSION}/traefik_v${VERSION}_$(get_os)_$(get_arch).tar.gz
extract_tarball "${URL}" "${DEST}/${VERSION}"
set_current_link "${DEST}" "${VERSION}"
if [[ -L "$XDG_BIN_HOME/${APP}" ]]; then
unlink "$XDG_BIN_HOME/${APP}"
fi
cd "$XDG_BIN_HOME" || exit 1
REL_LINK="$(relative_path "${XDG_BIN_HOME}" "${DEST}/current/${APP}")"
ln -s "${REL_LINK}" ${APP}
Loading…
Cancel
Save