Improved output for starting/stopping.

This commit is contained in:
Martin Edenhofer 2015-07-16 21:56:54 +02:00
parent a8505ed5dd
commit 1f0ee62fbf

View file

@ -59,11 +59,11 @@ if ARGV[0] != 'start' && ARGV[0] != 'stop'
exit exit
end end
puts "Starting websocket server on #{@options[:b]}:#{@options[:p]} (secure:#{@options[:s]},pid:#{@options[:i]})"
#puts options.inspect
if ARGV[0] == 'stop' if ARGV[0] == 'stop'
puts "Stopping websocket server (pid:#{@options[:i]})"
#puts options.inspect
# read pid # read pid
pid = File.open( @options[:i].to_s ).read pid = File.open( @options[:i].to_s ).read
pid.gsub!(/\r|\n/, '') pid.gsub!(/\r|\n/, '')
@ -74,6 +74,9 @@ if ARGV[0] == 'stop'
end end
if ARGV[0] == 'start' && @options[:d] if ARGV[0] == 'start' && @options[:d]
puts "Starting websocket server on #{@options[:b]}:#{@options[:p]} (secure:#{@options[:s]},pid:#{@options[:i]})"
#puts options.inspect
Daemons.daemonize Daemons.daemonize
# create pid file # create pid file