From d992e28f4cb3c0e1f6ac77defb8892640a274f16 Mon Sep 17 00:00:00 2001 From: Akshay Kashyap Date: Tue, 1 Dec 2015 12:24:01 -0500 Subject: [PATCH] IP and Password change --- nodejs/fucking_coffee.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nodejs/fucking_coffee.js b/nodejs/fucking_coffee.js index 6e0b00e..c4c92b9 100644 --- a/nodejs/fucking_coffee.js +++ b/nodejs/fucking_coffee.js @@ -1,5 +1,5 @@ /* Before running: - npm install telnet-client +npm install telnet-client */ var exec = require('child_process').exec; @@ -13,13 +13,12 @@ exec("who", function(error, stdout, stderr) { if(stdout.indexOf(me) == -1) process.exit(/*1*/) - var coffee_machine_ip = '10.10.42.42' - var password = '1234' - var cmd = 'Password: ' + password + var coffee_machine_ip = 'xxx.xxx.xxx.xxx' + var password = 'xxxx' var con = new telnet() con.on('ready', function(prompt) { - con.exec(cmd, function(error, res) { + con.exec('Password: ' + password, function(error, res) { // Brew Coffee! con.exec('sys brew', function(error, res) {