Commit eb1ad6de authored by Jan Grewe's avatar Jan Grewe

try to detect broadcast address, if not specified

parent d9ef0aa6
......@@ -3,7 +3,6 @@ var config = require('./config.json');
var pathPhotos = config.pathPhotos;
var previewWidth = config.previewWidth;
var previewHeight = config.previewHeight;
var cardAddr = config.broadcastAddr;
var cardPath = null;
var pathPreviews = './public/previews';
......@@ -15,6 +14,7 @@ var downloadPrevious = true;
var downloadList = new Array();
var os = require('os');
var ip = require('ip');
var http = require('http');
var path = require('path');
var net = require('net');
......@@ -36,6 +36,12 @@ var routes = require('./routes/index');
var latestPhoto = require('./routes/latest');
var allPhotos = require('./routes/all');
var cardAddr = ip.subnet(ip.address(), '255.255.255.0').broadcastAddress;
if (typeof config.broadcastAddr !== undefined) {
cardAddr = config.broadcastAddr;
}
process.title = 'WiPho';
var gracefulShutdown = function() {
console.log("Shutting down...");
......
......@@ -2,6 +2,6 @@
"pathPhotos" : "/path/to/photos/folder",
"previewWidth" : 1920,
"previewHeight" : 1080,
"httpPort" : 80,
"broadcastAddr" : "192.168.0.255",
"httpPort" : 80
}
......@@ -12,6 +12,7 @@
"debug": "^0.7.0",
"express": "~4.12.2",
"gm": "^1.17.0",
"ip": "^0.3.2",
"jade": "^1.9.2",
"morgan": "^1.5.1",
"serve-favicon": "^2.2.0",
......
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