forked from obi-a/ragios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathragios
executable file
·35 lines (29 loc) · 985 Bytes
/
ragios
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env ruby
require "thor"
class RagiosCLI < Thor
desc "console", "Open Ragios Interactive Shell"
def console
ragios_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'ragios'))
config = ragios_dir + '/config'
irb = "bundle exec pry -r #{config}"
exec(irb)
end
desc "server start | restart | stop", "Run Ragios Server"
def server(option=nil)
exec('bundle exec pumactl -F server.rb start') if option == 'start'
if option == 'restart'
puts "Restarting Ragios..."
exec('bundle exec pumactl -F server.rb restart')
end
if option == 'stop'
puts "Stopping Ragios..."
exec('bundle exec pumactl -F server.rb stop')
end
if option == 'phased-restart'
puts "Ragios phased-restart in progress..."
exec('bundle exec pumactl -F server.rb phased-restart -p tmp/pids/puma.pid')
end
puts "Usage: ragios server start | stop | restart | phased-restart"
end
end
RagiosCLI.start(ARGV)