Browse files

env vars are ints

  • Loading branch information...
1 parent 2fb6952 commit 5df37646ffb28d4eddcbf0ec108c9efd17fc8f19 @portertech committed Aug 6, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 bin/tails
  2. +1 −1 test/syslog_test.js
View
4 bin/tails
@@ -16,8 +16,8 @@ var options = require("nomnom").opts({
var syslog = require('../lib/syslog')
var api = require('../lib/api')
-var syslogPort = process.env.TAILS_SYSLOG_PORT || options.syslog
-var httpPort = process.env.TAILS_HTTP_PORT || options.http
+var syslogPort = parseInt(process.env.TAILS_SYSLOG_PORT) || options.syslog
+var httpPort = parseInt(process.env.TAILS_HTTP_PORT) || options.http
syslog.server.bind(syslogPort)
api.server.listen(httpPort)
View
2 test/syslog_test.js
@@ -11,7 +11,7 @@ var options = require("nomnom").opts({
var message = new Buffer("<71>Nov 23 17:22:23 pirate_ship-127-0-0-1 all the piracy. none of the scurvy! all ye be walkin the plank if me timbers be shiverin. polly does not want a cracker but i will taketh one from ye.")
var syslog = dgram.createSocket("udp4")
-var syslogPort = process.env.TAILS_SYSLOG_PORT || options.syslog
+var syslogPort = parseInt(process.env.TAILS_SYSLOG_PORT) || options.syslog
setInterval(function() {
syslog.send(message, 0, message.length, syslogPort, '127.0.0.1',
function (err, bytes) {

0 comments on commit 5df3764

Please sign in to comment.