@cryptotaxi247 / netdata-1 / commits / 7647a12b0

when version.txt and internal version differ, use the internal one

Costa Tsaousis (ktsaou) committed Feb 12, 2017 at 14:05 UTC 7647a12b03d31e90cc2edd1546132bc0be973766
1 file changed +7 -5
web/index.html
+7 -5
@@ -2317,12 +2317,14 @@
2317 })
2318 .done(function(data) {
2319 data = data.replace(/(\r\n|\n|\r| |\t)/gm,"");
2320 - if(data.length !== 40) {
2321 - var c = getNetdataCommitIdFromVersion();
2322 - if(c === null) versionLog('Cannot find the git commit id of netdata.');
2323 - callback(c);
2320 +
2321 + var c = getNetdataCommitIdFromVersion();
2322 + if(c !== null && data.length === 40 && data.substring(0, 7) !== c) {
2323 + versionLog('Installed files commit id and internal netdata git commit id do not match');
2324 + data = c;
2325 }
2325 - else {
2326 +
2327 + if(data.length >= 7) {
2328 versionLog('Installed git commit id of netdata is ' + data);
2329 document.getElementById('netdataCommitId').innerHTML = data.substring(0, 7);
2330 callback(data);