From 9ea4cbe1e006f703d1367f5aa3229849775b7128 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 May 2011 14:27:19 +0200 Subject: roboctl: parse nick from tinc.conf --- modules/roboctl/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/roboctl/index.js b/modules/roboctl/index.js index bef53109..ac92c969 100644 --- a/modules/roboctl/index.js +++ b/modules/roboctl/index.js @@ -1,5 +1,9 @@ + +nick = /(^|\n) *Name *= *(\S*) *($|\n)/ + .exec(require('fs').readFileSync('/etc/tinc/retiolum/tinc.conf'))[2]; + var config = { - "nick": "roboctl", + "nick": nick + '-krebs', "server": "irc.freenode.net", "port": 6667, "channel": "#tincspasm" @@ -9,6 +13,6 @@ irc = require('./lib/irc').createClient(config); // TODO call back when joined irc.connect(function () { - console.log('like a boss'); + console.log('like a boss: ' + nick); //irc.write(); }); -- cgit v1.2.3