Skip to content

Commit

Permalink
If passed an argument, assume for now it is a configuration file
Browse files Browse the repository at this point in the history
and use it instead of the default.

We'll probably add some sort of getopt later.
  • Loading branch information
jperkin committed Feb 29, 2012
1 parent 282f16b commit 1adb97e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion node-statusmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
var fs = require('fs');
var os = require('os');

var config = require('./config');
/*
* If we're given an argument, assume for now it is a config file and load
* it instead of the default.
*/
if (process.argv[2]) {
if (process.argv[2].match(/^[.\/]/)) {
var config = require(process.argv[2]);
} else {
var config = require('./' + process.argv[2]);
}
} else {
var config = require('./config');
}

var probes = {};

Expand Down

0 comments on commit 1adb97e

Please sign in to comment.