 fs = require 'fs'
 path = require 'path'
 optimist = require 'optimist'
+crypto = require 'crypto'
 {spawn} = require 'child_process'
 
 argv = require('optimist')

    console.log 'Client connected'

    fileWatcher(file).on 'data', (data) ->
      client.publish
        topic: topic
        payload: data

mqtt.createClient port, host, (err, client) ->
  timeout = 5000
  client.connect
    keepalive: timeout

  setTimeout =>
    client.pingreq()
  , timeout

  publishLines = (data) ->
    for line in data.split('\n') when line isnt ""
      client.publish
        topic: topic
        payload: line

  client.on 'connack', (packet) ->
    if packet.returnCode isnt 0
