From 487f36fec6636a81de4b7ab9de2d7f27ee6e148e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jc=20Mi=C3=B1arro?= Date: Fri, 3 Jan 2025 18:55:06 +0100 Subject: [PATCH] Keep Lubelogger data after update to a new version (#1200) --- ct/lubelogger.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ct/lubelogger.sh b/ct/lubelogger.sh index 3bf3e12c..0f10b667 100644 --- a/ct/lubelogger.sh +++ b/ct/lubelogger.sh @@ -42,11 +42,19 @@ function update_script() { msg_info "Updating ${APP} to v${RELEASE}" cd /opt wget -q https://github.com/hargata/lubelog/releases/download/v${RELEASE}/LubeLogger_v${RELEASE_TRIMMED}_linux_x64.zip - cp /opt/lubelogger/appsettings.json /opt/appsettings.json + mkdir -p /tmp/lubeloggerData/wwwroot + cp /opt/lubelogger/appsettings.json /tmp/lubeloggerData/appsettings.json + cp -r /opt/lubelogger/config /tmp/lubeloggerData/ + cp -r /opt/lubelogger/data /tmp/lubeloggerData/ + [[ -e /opt/lubelogger/wwwroot/translations ]] && cp -r /opt/lubelogger/wwwroot/translations /tmp/lubeloggerData/wwwroot/ + [[ -e /opt/lubelogger/wwwroot/documents ]] && cp -r /opt/lubelogger/wwwroot/documents /tmp/lubeloggerData/wwwroot/ + [[ -e /opt/lubelogger/wwwroot/images ]] && cp -r /opt/lubelogger/wwwroot/images /tmp/lubeloggerData/wwwroot/ + [[ -e /opt/lubelogger/wwwroot/temp ]] && cp -r /opt/lubelogger/wwwroot/temp /tmp/lubeloggerData/wwwroot/ + [[ -e /opt/lubelogger/log ]] && cp -r /opt/lubelogger/log /tmp/lubeloggerData/ rm -rf /opt/lubelogger unzip -qq LubeLogger_v${RELEASE_TRIMMED}_linux_x64.zip -d lubelogger chmod 700 /opt/lubelogger/CarCareTracker - mv -f /opt/appsettings.json /opt/lubelogger/appsettings.json + cp -rf /tmp/lubeloggerData/* /opt/lubelogger/ echo "${RELEASE}" >"/opt/${APP}_version.txt" msg_ok "Updated ${APP} to v${RELEASE}" @@ -56,6 +64,7 @@ function update_script() { msg_info "Cleaning up" rm -rf /opt/LubeLogger_v${RELEASE_TRIMMED}_linux_x64.zip + rm -rf /tmp/lubeloggerData msg_ok "Cleaned" msg_ok "Updated Successfully" else @@ -71,4 +80,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"