mirror of
https://github.com/jimeh/skyhook.git
synced 2026-02-19 11:06:38 +00:00
34 lines
532 B
Ruby
Executable File
34 lines
532 B
Ruby
Executable File
#! /usr/bin/env ruby
|
|
|
|
##
|
|
# Skyhook Services - Remote Init Script
|
|
##
|
|
|
|
$console = false
|
|
$LOAD_PATH << File.dirname(__FILE__)
|
|
require "init"
|
|
|
|
|
|
# parse input and run
|
|
case ARGV[0]
|
|
when "start"
|
|
Skyhook.start
|
|
when "stop"
|
|
Skyhook.stop
|
|
when "restart"
|
|
Skyhook.restart
|
|
when "status"
|
|
Skyhook.status
|
|
when "mode"
|
|
ARGV.shift
|
|
Mode.do(ARGV)
|
|
else
|
|
which = ARGV.shift.to_s.split(".")
|
|
action = Action.send(which[0].to_s.downcase.to_sym, which[1], *ARGV) rescue Process.exit(1)
|
|
if !action
|
|
Process.exit(1)
|
|
end
|
|
end
|
|
|
|
Process.exit(0)
|