File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -36,23 +36,21 @@ function update_script() {
3636 msg_ok " Stopped ${APP} "
3737
3838 msg_info " Updating ${APP} to v${VERSION} "
39- PREVIOUS_VERSION=" $( readlink -f /opt/teddycloud) "
39+ cd /opt
40+ mv /opt/teddycloud /opt_teddycloud_bak
4041 wget -q " https://github.com/toniebox-reverse-engineering/teddycloud/releases/download/${RELEASE} /teddycloud.amd64.release_v${VERSION} .zip"
41- unzip -q -d " /opt/teddycloud- ${VERSION} " " teddycloud.amd64.release_v${VERSION} .zip"
42- ln -fns " /opt/teddycloud- ${VERSION} " /opt/teddycloud
42+ unzip -q -d /opt/teddycloud teddycloud.amd64.release_v${VERSION} .zip
43+ cp -R /opt_teddycloud_bak/certs /opt_teddycloud_bak/config /opt_teddycloud_bak/data /opt/teddycloud
4344 echo " ${VERSION} " > " /opt/${APP} _version.txt"
44- cp -R " ${PREVIOUS_VERSION} /certs" /opt/teddycloud
45- cp -R " ${PREVIOUS_VERSION} /config" /opt/teddycloud
46- cp -R " ${PREVIOUS_VERSION} /data" /opt/teddycloud
4745 msg_ok " Updated ${APP} to v${VERSION} "
4846
4947 msg_info " Starting ${APP} "
5048 systemctl start teddycloud
5149 msg_ok " Started ${APP} "
5250
5351 msg_info " Cleaning up"
54- rm " teddycloud.amd64.release_v${VERSION} .zip"
55- rm -rf " ${PREVIOUS_VERSION} "
52+ rm -rf /opt/ teddycloud.amd64.release_v${VERSION} .zip
53+ rm -rf /opt/teddycloud_bak
5654 msg_ok " Cleaned"
5755 else
5856 msg_ok " No update required. ${APP} is already at v${VERSION} "
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ VERSION="${RELEASE#tc_v}"
3030wget -q " https://github.com/toniebox-reverse-engineering/teddycloud/releases/download/${RELEASE} /teddycloud.amd64.release_v${VERSION} .zip"
3131unzip -q -d " /opt/teddycloud-${VERSION} " " teddycloud.amd64.release_v${VERSION} .zip"
3232ln -fns " /opt/teddycloud-${VERSION} " /opt/teddycloud
33+ rm -rf teddycloud.amd64.release_v${VERSION} .zip
3334echo " ${VERSION} " > " /opt/${APPLICATION} _version.txt"
3435msg_ok " Installed TeddyCloud"
3536
You can’t perform that action at this time.
0 commit comments