You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
694 B
Plaintext

#!/usr/bin/env bash
set -e
# shellcheck disable=SC1090
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
APP=lego
VERSION=${VERSION:-v4.9.0}
APPS_DIR=/usr/local/apps/${APP}
URL=https://github.com/go-acme/lego/releases/download/${VERSION}/lego_${VERSION}_$(get_os)_$(get_arch).tar.gz
extract_tarball "${URL}" "${APPS_DIR}/${VERSION}" "" sudo
set_current_link "${APPS_DIR}" "${VERSION}" sudo
apps=$(find ${APPS_DIR}/current/ -maxdepth 1 -executable -type f -exec basename {} \;)
cd /usr/local/bin
for bin in $apps; do
if [[ ! -s $bin ]]; then
sudo ln --symbolic \
"$(relative_path "/usr/local/bin" "${APPS_DIR}/current/${bin}")" \
"${bin}"
fi
done