mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 02:09:17 +00:00
Fix: Alpine IT-Tools Update (#2067)
* Fix: Alpine ITTools Update * remove wget
This commit is contained in:
parent
82fecd7bbd
commit
f5a73a5449
@ -29,27 +29,28 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /usr/share/nginx/html ]]; then
|
if [ ! -d /usr/share/nginx/html ]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/CorentinTh/it-tools/releases/latest | grep '"tag_name":' | cut -d '"' -f4)
|
RELEASE=$(curl -s https://api.github.com/repos/CorentinTh/it-tools/releases/latest | grep '"tag_name":' | cut -d '"' -f4)
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null)" ] || [ ! -f /opt/${APP}_version.txt ]; then
|
||||||
DOWNLOAD_URL="https://github.com/CorentinTh/it-tools/releases/download/${RELEASE}/it-tools-${RELEASE#v}.zip"
|
DOWNLOAD_URL="https://github.com/CorentinTh/it-tools/releases/download/${RELEASE}/it-tools-${RELEASE#v}.zip"
|
||||||
msg_info "Updating ${APP} LXC"
|
msg_info "Updating ${APP} LXC"
|
||||||
curl -fsSL -o it-tools.zip "$DOWNLOAD_URL"
|
curl -fsSL -o it-tools.zip "$DOWNLOAD_URL"
|
||||||
mkdir -p /usr/share/nginx/html
|
mkdir -p /usr/share/nginx/html
|
||||||
rm -rf /usr/share/nginx/html/*
|
rm -rf /usr/share/nginx/html/*
|
||||||
unzip -q it-tools.zip -d /tmp/it-tools
|
unzip -q it-tools.zip -d /tmp/it-tools
|
||||||
cp -r /tmp/it-tools/dist/* /usr/share/nginx/html
|
cp -r /tmp/it-tools/dist/* /usr/share/nginx/html
|
||||||
rm -rf /tmp/it-tools
|
rm -rf /tmp/it-tools
|
||||||
rm -f it-tools.zip
|
rm -f it-tools.zip
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
fi
|
fi
|
||||||
exit
|
|
||||||
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
Loading…
Reference in New Issue
Block a user