summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/install-or-update.sh
diff options
context:
space:
mode:
authorPaul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-08-29 23:24:18 +0300
committerGitHub <noreply@github.com>2019-08-29 23:24:18 +0300
commitefb00d6d2fb0e3894f491aba2993f59c2c076555 (patch)
tree3466f51b39a2ca1d98b636a5290f9d7616d2d2a1 /packaging/makeself/install-or-update.sh
parentb39b1be94a5f3fbbf4b06eadae05ec44bef68859 (diff)
netdata/installer: fix static64 installer always overwriting configuration (#6710)
* netdata/packaging: static installer - back up configuration directory, if it already exists * netdata/packaging: keep more versions of it, we will consider how to consolidate too old ones * netdata/packaging: At the post install activities, if .old directory was in place, reinstate it (WIP) * netdata/packaging: Attempt to trigger stock config refresh * netdata/packaging: the .new directory is just the latest one, no need to keep it when re-running * netdata/packaging: dont do -f, its -d to confirm existence of dir
Diffstat (limited to 'packaging/makeself/install-or-update.sh')
-rwxr-xr-xpackaging/makeself/install-or-update.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/packaging/makeself/install-or-update.sh b/packaging/makeself/install-or-update.sh
index 165e7920bd..9796eb0851 100755
--- a/packaging/makeself/install-or-update.sh
+++ b/packaging/makeself/install-or-update.sh
@@ -10,6 +10,15 @@ umask 002
renice 19 $$ >/dev/null 2>/dev/null
# -----------------------------------------------------------------------------
+if [ -d /opt/netdata/etc/netdata.old ]; then
+ progress "Found old etc/netdata directory, reinstating this"
+ [ -d /opt/netdata/etc/netdata.new ] && rm -rf /opt/netdata/etc/netdata.new
+ mv -f /opt/netdata/etc/netdata /opt/netdata/etc/netdata.new
+ mv -f /opt/netdata/etc/netdata.old /opt/netdata/etc/netdata
+
+ progress "Trigger stock config clean up"
+ rm -f /opt/netdata/etc/netdata/.installer-cleanup-of-stock-configs-done
+fi
STARTIT=1