Created
February 1, 2014 01:10
-
-
Save pyk/8746519 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.run | |
# set current working directory | |
file_path = File.expand_path(__FILE__) # File.join(Dir.getwd, __FILE__)) | |
file_workdir = File.dirname( file_path ) | |
file_logdir = File.join(file_workdir, 'log') | |
Dir.chdir file_workdir | |
@@cwd = Dir.getwd | |
@@name = File.basename($0) | |
@@hostname = Socket.gethostname | |
@@dir = file_workdir | |
APP_INFO << " on #{@@hostname}" | |
if configure then | |
show_version | |
stopped = if ['stop','restart'].include?(@@cmd) then | |
command_stop | |
end | |
if ['run','start','restart'].include?(@@cmd) && stopped != false then | |
@@cmd = 'start' if @@cmd == 'restart' | |
command_start | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment