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
c1d86513d5
commit
d66bbc4d10
@ -28,22 +28,22 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -f /opt/opengist/opengist ]]; then
|
||||
if [[ ! -d /opt/opengist ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating ${APP} LXC"
|
||||
LATEST_URL=$(curl -s https://api.github.com/repos/thomiceli/opengist/releases/latest | jq -r '.assets[] | select(.name | contains("linux-amd64.tar.gz")).browser_download_url')
|
||||
wget "$LATEST_URL"
|
||||
mv opengist*.tar.gz opengist.tar.gz
|
||||
tar -xf opengist.tar.gz
|
||||
mv opengist/opengist /opt/opengist/opengist
|
||||
mv opengist/config.yml /opt/opengist/config.yml
|
||||
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
|
||||
msg_info "Updating ${APP} to v${RELEASE}"
|
||||
cd /opt
|
||||
wget -qO "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
||||
rm -rf /opt/opengist
|
||||
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
||||
chmod +x /opt/opengist/opengist
|
||||
rm -rf opengist*
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
msg_ok "Updated Successfully"
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user