Commit 5e40ac96 authored by nilanjandaw's avatar nilanjandaw

ip parsing bug fix

parent fdef6073
{"id":"src","master_node":"10.129.6.5"} {"id":"192.168.31.51","master_node":"10.129.6.5"}
\ No newline at end of file \ No newline at end of file
...@@ -16,9 +16,8 @@ function updateConfig() { ...@@ -16,9 +16,8 @@ function updateConfig() {
let data = getIP.stdout.toString().trim() let data = getIP.stdout.toString().trim()
data = data.substr(0, data.indexOf("\n")).trim() data = data.substr(0, data.indexOf("\n")).trim()
data = data.split(' ') data = data.split(' ')
console.log(data);
file.id = data[data.length - 4] file.id = data[data.length - 3]
fs.writeFileSync('./config.json', JSON.stringify(file)); fs.writeFileSync('./config.json', JSON.stringify(file));
console.log("Updated Config file"); console.log("Updated Config file");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment