diff --git a/lib/WatchDog.js b/lib/WatchDog.js index 0c8f154c..81e283ad 100644 --- a/lib/WatchDog.js +++ b/lib/WatchDog.js @@ -23,7 +23,7 @@ function generateId() { var crypto = require('crypto'); var os = require('os'); - var parts = [os.hostname(), process.pid, +(new Date)]; + var parts = [os.hostname(), JSON.stringify(os.networkInterfaces)]; var hash = crypto.createHash('md5').update(parts.join('')); return hash.digest('hex'); } diff --git a/scripts/install.js b/scripts/install.js index 9790a844..ee194751 100644 --- a/scripts/install.js +++ b/scripts/install.js @@ -4,6 +4,10 @@ var WatchDog = require('../lib/WatchDog.js'); var fs = require('fs'); var cst = require('../constants.js'); +if (fs.existsSync(cst.WATCHDOG_FILE)) { + process.exit(0); +} + (function pre_init() { fs.exists(cst.DEFAULT_FILE_PATH, function(exist) { if (!exist) {