aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-06-15 19:29:34 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-06-15 19:29:34 +0100
commitbd1e5a7fd54cde0584a3465fe213cb8554d995b1 (patch)
tree06aaa8caee79b701191f24ed530ee85dda1d2ac4 /bin
parentd21bd309d9fae7979550e09ba7b16526cd40977c (diff)
Tidied up mauveconsole to work.
Diffstat (limited to 'bin')
-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