diff --git a/ct/authelia.sh b/ct/authelia.sh index 2ab3bce03..4dbd69fa2 100644 --- a/ct/authelia.sh +++ b/ct/authelia.sh @@ -22,30 +22,30 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d "/etc/authelia/" ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/authelia/authelia/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(/usr/bin/authelia -v | awk '{print substr($3, 2, length($2)) }')" ]]; then - msg_info "Updating $APP to ${RELEASE}" - $STD apt-get update - $STD apt-get -y upgrade - curl -fsSL "https://github.com/authelia/authelia/releases/download/${RELEASE}/authelia_${RELEASE}_amd64.deb" -o $(basename "https://github.com/authelia/authelia/releases/download/${RELEASE}/authelia_${RELEASE}_amd64.deb") - $STD dpkg -i "authelia_${RELEASE}_amd64.deb" - msg_info "Cleaning Up" - rm -f "authelia_${RELEASE}_amd64.deb" - $STD apt-get -y autoremove - $STD apt-get -y autoclean - msg_ok "Cleanup Completed" - msg_ok "Updated $APP to ${RELEASE}" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d "/etc/authelia/" ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/authelia/authelia/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ "${RELEASE}" != "$(/usr/bin/authelia -v | awk '{print substr($3, 2, length($2)) }')" ]]; then + $STD apt-get update + $STD apt-get -y upgrade + + fetch_and_deploy_gh_release "authelia" "authelia/authelia" "binary" + + msg_info "Cleaning Up" + $STD apt-get -y autoremove + $STD apt-get -y autoclean + msg_ok "Cleanup Completed" + + msg_ok "Updated $APP to ${RELEASE}" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit } start diff --git a/install/authelia-install.sh b/install/authelia-install.sh index fb3d348b0..d1e850483 100644 --- a/install/authelia-install.sh +++ b/install/authelia-install.sh @@ -13,13 +13,9 @@ setting_up_container network_check update_os -msg_info "Installing Authelia" -RELEASE=$(curl -fsSL https://api.github.com/repos/authelia/authelia/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -curl -fsSL "https://github.com/authelia/authelia/releases/download/${RELEASE}/authelia_${RELEASE}_amd64.deb" -o "authelia_${RELEASE}_amd64.deb" -$STD dpkg -i "authelia_${RELEASE}_amd64.deb" -msg_ok "Install Authelia completed" +fetch_and_deploy_gh_release "authelia" "authelia/authelia" "binary" -read -p "${TAB3}Enter your domain (ex. example.com): " DOMAIN +read -rp "${TAB3}Enter your domain (ex. example.com): " DOMAIN msg_info "Setting Authelia up" touch /etc/authelia/emails.txt @@ -72,7 +68,6 @@ motd_ssh customize msg_info "Cleaning up" -rm -f "authelia_${RELEASE}_amd64.deb" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"