diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-04-02 03:31:32 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-04-02 03:31:32 +0300 |
commit | 345e5c7306c1e6544e304883a8d4c4f3e0b3a16e (patch) | |
tree | b729b82d63ca9f779f8274761b93226634415e6a /makeself | |
parent | d8f4940b79407f76f794a9b3fa517f068a2fa6b5 (diff) |
properly find md5sum
Diffstat (limited to 'makeself')
-rwxr-xr-x | makeself/install-or-update.sh | 19 | ||||
-rwxr-xr-x | makeself/jobs/99-makeself.install.sh | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/makeself/install-or-update.sh b/makeself/install-or-update.sh index 2331305fb5..658d408f79 100755 --- a/makeself/install-or-update.sh +++ b/makeself/install-or-update.sh @@ -20,6 +20,7 @@ if [ ! -d etc/netdata ] run mkdir -p etc/netdata fi +md5sum="$(which md5sum 2>/dev/null || command -v md5sum 2>/dev/null || command -v md5 2>/dev/null)" for x in $(find etc/netdata.new -name '*.conf' -type f) do # find it relative filename @@ -42,15 +43,19 @@ do continue fi - # find the checksum of the existing file - md5="$(cat "${t}" | md5sum | cut -d ' ' -f 1)" - #echo >&2 "md5: ${md5}" - - # check if it matches - if [ "${configs_signatures[${md5}]}" = "${f}" ] + if [ ! -z "${md5sum}" ] then - run cp "${x}" "${t}" + # find the checksum of the existing file + md5="$(cat "${t}" | ${md5sum} | cut -d ' ' -f 1)" + #echo >&2 "md5: ${md5}" + + # check if it matches + if [ "${configs_signatures[${md5}]}" = "${f}" ] + then + run cp "${x}" "${t}" + fi fi + run mv "${x}" "${t}.orig" done diff --git a/makeself/jobs/99-makeself.install.sh b/makeself/jobs/99-makeself.install.sh index e957bf0740..5c57ec8fbd 100755 --- a/makeself/jobs/99-makeself.install.sh +++ b/makeself/jobs/99-makeself.install.sh @@ -54,7 +54,7 @@ fi # ----------------------------------------------------------------------------- -# remove the links to allow the untaring the archive +# remove the links to allow untaring the archive rm "${NETDATA_INSTALL_PATH}/sbin" \ "${NETDATA_INSTALL_PATH}/usr/bin" \ |