Files
skyhook/init/rc.rb
2009-12-10 20:45:56 +02:00

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)