mirror of
https://github.com/tteck/Proxmox.git
synced 2024-12-27 07:21:59 +00:00
Update flaresolverr.sh
refactor update
This commit is contained in:
parent
cabfa3ba2f
commit
99f50a5bc2
@ -54,22 +54,21 @@ function default_settings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
if [[ ! -f /etc/systemd/system/flaresolverr.service ]]; then
|
|
||||||
msg_error "No ${APP} Installation Found!"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
header_info
|
header_info
|
||||||
|
if [[ ! -f /etc/systemd/system/flaresolverr.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
|
RELEASE=$(wget -q https://github.com/FlareSolverr/FlareSolverr/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
|
||||||
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
msg_info "Updating $APP LXC"
|
msg_info "Updating $APP LXC"
|
||||||
systemctl stop flaresolverr
|
systemctl stop flaresolverr
|
||||||
|
|
||||||
# install flaresolverr
|
|
||||||
RELEASE=$(wget -q https://github.com/FlareSolverr/FlareSolverr/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
|
|
||||||
wget -q https://github.com/FlareSolverr/FlareSolverr/releases/download/$RELEASE/flaresolverr_linux_x64.tar.gz
|
wget -q https://github.com/FlareSolverr/FlareSolverr/releases/download/$RELEASE/flaresolverr_linux_x64.tar.gz
|
||||||
tar -xzf flaresolverr_linux_x64.tar.gz -C /opt
|
tar -xzf flaresolverr_linux_x64.tar.gz -C /opt
|
||||||
rm flaresolverr_linux_x64.tar.gz
|
rm flaresolverr_linux_x64.tar.gz
|
||||||
|
|
||||||
systemctl start flaresolverr
|
systemctl start flaresolverr
|
||||||
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
msg_ok "Updated $APP LXC"
|
msg_ok "Updated $APP LXC"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user