Sha256: dec03ac6e760a3986fa9340efdfb6152b50e08dda94e2ac30135b56f7d80425e
Contents?: true
Size: 1.39 KB
Versions: 1
Compression:
Stored size: 1.39 KB
Contents
#!/usr/bin/env ruby #/ Usage: rmails action [options] #/ #/ Actions: #/ --install #/ Install all compoments of the system. #/ You must be root to run this. #/ --start-app #/ Starts server of configuration app. #/ You may have to be root to run this. #/ --stop-app #/ Stops server of configuration app. #/ You may have to be root to run this. #/ Options: #/ --clear #/ Truncate data in database. #/ $stderr.sync = true require 'optparse' require File.expand_path('../../config/application', __FILE__) require 'rmails/installer' require 'rmails/runner' # default options install = false start = false stop = false clear = false # parse arguments file = __FILE__ ARGV.options do |opts| opts.on("--install") { |install| } opts.on("--start-app") { |start| } opts.on("--stop-app") { |stop| } opts.on("--clear") { |clear| } opts.on_tail("-h", "--help") { exec "grep ^#/<'#{file}'|cut -c4-" } opts.parse! end if (start and stop) or (install and (start or stop)) or not (install or start or stop) exec "grep ^#/<'#{file}'|cut -c4-" end # bug that helps to have better condition if install setup = Rmails::Installer.new({:clear => clear}) setup.run elsif start app = Rmails::Runner.new app.start elsif stop app = Rmails::Runner.new app.stop end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rmails-0.2.5 | bin/rmails |