mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-01 15:51:51 +00:00
Fix updater (#1572)
This commit is contained in:
parent
f8f166e26f
commit
c4580100a8
@ -32,29 +32,35 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
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 "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop opengist.service
|
systemctl stop opengist.service
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
apt-get update &>/dev/null
|
|
||||||
apt-get upgrade &>/dev/null
|
|
||||||
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}"
|
msg_info "Updating ${APP} to v${RELEASE}"
|
||||||
|
apt-get update &>/dev/null
|
||||||
|
apt-get -y upgrade &>/dev/null
|
||||||
cd /opt
|
cd /opt
|
||||||
wget -qO "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
mv /opt/opengist /opt/opengist-backup
|
||||||
rm -rf /opt/opengist
|
wget -q "https://github.com/thomiceli/opengist/releases/download/v${RELEASE}/opengist${RELEASE}-linux-amd64.tar.gz"
|
||||||
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
tar -xzf opengist${RELEASE}-linux-amd64.tar.gz
|
||||||
|
mv /opt/opengist-backup/config.yml /opt/opengist/config.yml
|
||||||
chmod +x /opt/opengist/opengist
|
chmod +x /opt/opengist/opengist
|
||||||
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
||||||
rm -rf /opt/opengist${RELEASE}-linux-amd64.tar.gz
|
|
||||||
apt-get -y autoremove &>/dev/null
|
|
||||||
apt-get -y autoclean &>/dev/null
|
|
||||||
msg_ok "Updated ${APP} LXC"
|
msg_ok "Updated ${APP} LXC"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start opengist.service
|
systemctl start opengist.service
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
rm -rf /opt/opengist${RELEASE}-linux-amd64.tar.gz
|
||||||
|
rm -rf /opt/opengist-backup
|
||||||
|
apt-get -y autoremove &>/dev/null
|
||||||
|
apt-get -y autoclean &>/dev/null
|
||||||
|
msg_ok "Cleaned"
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
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
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
],
|
],
|
||||||
"date_created": "2025-01-14",
|
"date_created": "2025-01-14",
|
||||||
"type": "ct",
|
"type": "ct",
|
||||||
"updateable": false,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 6157,
|
"interface_port": 6157,
|
||||||
"documentation": null,
|
"documentation": null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user