aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/mauveconsole28
1 files changed, 14 insertions, 14 deletions
diff --git a/bin/mauveconsole b/bin/mauveconsole
index d375139..debe5af 100755
--- a/bin/mauveconsole
+++ b/bin/mauveconsole
@@ -1,23 +1,23 @@
#!/usr/bin/ruby1.8
require 'pp'
-pp $:
-
-Thread.abort_on_exception = true
require 'irb'
require 'thread'
+require 'mauve/configuration'
-# hack for delving into test-generated configurations
-class AlertAndNotificationLogic; Alerts = Queue.new; end
+Thread.abort_on_exception = true
-require 'mauve/configuration'
-include Mauve
-#raise "must specify config file" unless ARGV.length > 0
-unless ARGV.length > 0
- STDERR.print("You must specify a configuration file as $arg[1]\n")
- STDERR.print(" eg: ./mauve_starter ./bin/console ./test/local.conf\n")
- exit 1
+configuration_file = ARGV.shift
+configuration_file = [".", "/etc/mauvealert/"].find{|d| File.file?(File.join(d,"mauveserver.conf")) } if configuration_file.nil?
+configuration_file = File.expand_path(configuration_file)
+
+unless File.file?(configuration_file)
+ STDERR.print "Configuration file #{configuration_file} not found"
+ Kernel.exit 1
end
-Configuration.current = ConfigurationBuilder.load(ARGV.shift)
-IRB.start
+Mauve::Configuration.current = Mauve::ConfigurationBuilder.load(configuration_file)
+
+include Mauve
+
+IRB.start