Update librespeed.sh

This commit is contained in:
Slaviša Arežina 2025-04-26 18:40:09 +02:00 committed by GitHub
parent 03199562d5
commit 569d3cfc31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,16 +20,16 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/librespeed/index.html ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then
if [[ ! -f /opt/librespeed/index.html ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then
msg_info "Updating $APP..."
temp_file=$(mktemp)
curl -fsSL "https://github.com/librespeed/speedtest/archive/refs/tags/${RELEASE}.zip" -o $temp_file
@ -41,7 +41,7 @@ function update_script() {
echo "${RELEASE}" >"/opt/librespeed/librespeed_version.txt"
systemctl restart caddy
msg_ok "$APP has been updated."
else
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
@ -53,5 +53,5 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"