@@ -23,12 +23,13 @@ function update_script() {
2323 header_info
2424 check_container_storage
2525 check_container_resources
26+
2627 if [[ ! -d /opt/commafeed ]]; then
2728 msg_error " No ${APP} Installation Found!"
2829 exit
2930 fi
3031 RELEASE=$( curl -fsSL https://api.github.com/repos/Athou/commafeed/releases/latest | grep ' "tag_name":' | cut -d' "' -f4)
31- if [[ ! -f /opt/ ${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/ ${APP} _version.txt ) " ]]; then
32+ if [[ " ${RELEASE} " != " $( cat ~ /.commafeed 2> /dev/null ) " ]] || [[ ! -f ~ /.commafeed ]]; then
3233 msg_info " Stopping ${APP} "
3334 systemctl stop commafeed
3435 msg_ok " Stopped ${APP} "
@@ -39,13 +40,15 @@ function update_script() {
3940 $STD apt-get install -y rsync
4041 msg_ok " Installed Dependencies"
4142 fi
42-
43+ if [ -d /opt/commafeed/data ] && [ " $( ls -A /opt/commafeed/data) " ]; then
44+ mv /opt/commafeed/data /opt/data.bak
45+ fi
46+ fetch_and_deploy_gh_release " commafeed" " Athou/commafeed" " prebuild" " latest" " /opt/commafeed" " commafeed-*-h2-jvm.zip"
47+
4348 msg_info " Updating ${APP} to ${RELEASE} "
44- curl -fsSL " https://github.com/Athou/commafeed/releases/download/${RELEASE} /commafeed-${RELEASE} -h2-jvm.zip" -o $( basename " https://github.com/Athou/commafeed/releases/download/${RELEASE} /commafeed-${RELEASE} -h2-jvm.zip" )
45- $STD unzip commafeed-" ${RELEASE} " -h2-jvm.zip
46- rsync -a --exclude ' data/' commafeed-" ${RELEASE} " -h2/ /opt/commafeed/
47- rm -rf commafeed-" ${RELEASE} " -h2 commafeed-" ${RELEASE} " -h2-jvm.zip
48- echo " ${RELEASE} " > /opt/${APP} _version.txt
49+ if [ -d /opt/commafeed/data.bak ] && [ " $( ls -A /opt/commafeed/data.bak) " ]; then
50+ mv /opt/commafeed/data.bak /opt/commafeed/data
51+ fi
4952 msg_ok " Updated ${APP} to ${RELEASE} "
5053
5154 msg_info " Starting ${APP} "
0 commit comments