mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-09 01:09:16 +00:00
Update opengist.sh
This commit is contained in:
parent
186e392fac
commit
709ae1742e
@ -32,15 +32,25 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
msg_info "Stopping Service"
|
||||||
|
systemctl stop opengist.service
|
||||||
|
msg_ok "Stopped Service"
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
msg_info "Updating ${APP} to v${RELEASE}"
|
msg_info "Updating ${APP} to v${RELEASE}"
|
||||||
cd /opt
|
cd /opt
|
||||||
wget -qO "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
wget -qO "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
||||||
rm -rf /opt/opengist
|
rm -rf /opt/opengist
|
||||||
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
||||||
|
rm -rf /opt/opengist${RELEASE}-linux-amd64.tar.gz
|
||||||
chmod +x /opt/opengist/opengist
|
chmod +x /opt/opengist/opengist
|
||||||
|
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
||||||
msg_ok "Updated ${APP} LXC"
|
msg_ok "Updated ${APP} LXC"
|
||||||
|
|
||||||
|
msg_info "Starting Service"
|
||||||
|
systemctl start opengist.service
|
||||||
|
msg_ok "Started Service"
|
||||||
|
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user