Fix: Teddycloud Script (install, clean up & update) (#1652)

* Update teddycloud-install.sh

* Update teddycloud.sh
This commit is contained in:
CanbiZ 2025-01-21 20:11:31 +01:00 committed by GitHub
parent e6404a9a4e
commit 621416698a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 8 deletions

View File

@ -36,14 +36,12 @@ function update_script() {
msg_ok "Stopped ${APP}" msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to v${VERSION}" msg_info "Updating ${APP} to v${VERSION}"
PREVIOUS_VERSION="$(readlink -f /opt/teddycloud)" cd /opt
mv /opt/teddycloud /opt_teddycloud_bak
wget -q "https://github.com/toniebox-reverse-engineering/teddycloud/releases/download/${RELEASE}/teddycloud.amd64.release_v${VERSION}.zip" wget -q "https://github.com/toniebox-reverse-engineering/teddycloud/releases/download/${RELEASE}/teddycloud.amd64.release_v${VERSION}.zip"
unzip -q -d "/opt/teddycloud-${VERSION}" "teddycloud.amd64.release_v${VERSION}.zip" unzip -q -d /opt/teddycloud teddycloud.amd64.release_v${VERSION}.zip
ln -fns "/opt/teddycloud-${VERSION}" /opt/teddycloud cp -R /opt_teddycloud_bak/certs /opt_teddycloud_bak/config /opt_teddycloud_bak/data /opt/teddycloud
echo "${VERSION}" >"/opt/${APP}_version.txt" echo "${VERSION}" >"/opt/${APP}_version.txt"
cp -R "${PREVIOUS_VERSION}/certs" /opt/teddycloud
cp -R "${PREVIOUS_VERSION}/config" /opt/teddycloud
cp -R "${PREVIOUS_VERSION}/data" /opt/teddycloud
msg_ok "Updated ${APP} to v${VERSION}" msg_ok "Updated ${APP} to v${VERSION}"
msg_info "Starting ${APP}" msg_info "Starting ${APP}"
@ -51,8 +49,8 @@ function update_script() {
msg_ok "Started ${APP}" msg_ok "Started ${APP}"
msg_info "Cleaning up" msg_info "Cleaning up"
rm "teddycloud.amd64.release_v${VERSION}.zip" rm -rf /opt/teddycloud.amd64.release_v${VERSION}.zip
rm -rf "${PREVIOUS_VERSION}" rm -rf /opt/teddycloud_bak
msg_ok "Cleaned" msg_ok "Cleaned"
else else
msg_ok "No update required. ${APP} is already at v${VERSION}" msg_ok "No update required. ${APP} is already at v${VERSION}"

View File

@ -30,6 +30,7 @@ VERSION="${RELEASE#tc_v}"
wget -q "https://github.com/toniebox-reverse-engineering/teddycloud/releases/download/${RELEASE}/teddycloud.amd64.release_v${VERSION}.zip" wget -q "https://github.com/toniebox-reverse-engineering/teddycloud/releases/download/${RELEASE}/teddycloud.amd64.release_v${VERSION}.zip"
unzip -q -d "/opt/teddycloud-${VERSION}" "teddycloud.amd64.release_v${VERSION}.zip" unzip -q -d "/opt/teddycloud-${VERSION}" "teddycloud.amd64.release_v${VERSION}.zip"
ln -fns "/opt/teddycloud-${VERSION}" /opt/teddycloud ln -fns "/opt/teddycloud-${VERSION}" /opt/teddycloud
rm -rf teddycloud.amd64.release_v${VERSION}.zip
echo "${VERSION}" >"/opt/${APPLICATION}_version.txt" echo "${VERSION}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed TeddyCloud" msg_ok "Installed TeddyCloud"