Sha256: 02ece2f00c83a27a22637fb9b38bf3bf2682554b49b54fbdbe439727d18508c9

Contents?: true

Size: 1.65 KB

Versions: 19

Compression:

Stored size: 1.65 KB

Contents

#!/usr/bin/env ruby -wKU

module Scout
  class Command
    class Install < Command
      def run
        create_pid_file_or_exit

        abort usage unless $stdin.tty?
        
        puts <<-END_INTRO.gsub(/^ {8}/, "")
        === Scout Installation Wizard ===

        You need the Server Key displayed in the Server Settings tab.
        It looks like:

          6ecad322-0d17-4cb8-9b2c-a12c4541853f

        Enter the Server Key:
        END_INTRO
        key = gets.to_s.strip

        puts "\nAttempting to contact the server..."
        begin
          Scout::Server.new(server, key, history, log) do |scout|
            scout.fetch_plan
            scout.run_plugins_by_plan
          end

          puts <<-END_SUCCESS.gsub(/^ {10}/, "")
          Success!

          Now, you must setup Scout to run on a scheduled basis.

          If you are using the system crontab
          (usually located at /etc/crontab):

          ****** START CRONTAB SAMPLE ******
          * * * * *  #{user} #{program_path} #{key}
          ******  END CRONTAB SAMPLE  ******

          If you are using this current user's crontab
          (using crontab -e to edit):

          ****** START CRONTAB SAMPLE ******
          * * * * *  #{program_path} #{key}
          ******  END CRONTAB SAMPLE  ******

          For help setting up Scout with crontab, please visit:

            http://scoutapp.com/help#cron

          END_SUCCESS
        rescue SystemExit
          puts $!.message
          puts <<-END_ERROR.gsub(/^ {10}/, "")

          Failed. 
          For more help, please visit:

          http://scoutapp.com/help

          END_ERROR
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
scout-5.4.6.alpha lib/scout/command/install.rb
scout-5.4.5.1.alpha lib/scout/command/install.rb
scout-5.4.5.alpha lib/scout/command/install.rb
scout-5.4.4.alpha lib/scout/command/install.rb
scout-5.3.4 lib/scout/command/install.rb
scout-5.3.3 lib/scout/command/install.rb
scout-5.3.2 lib/scout/command/install.rb
scout-5.3.1 lib/scout/command/install.rb
es-scout-5.3.0.es1 lib/es-scout/command/install.rb
es-scout-5.3.0 lib/es-scout/command/install.rb
scout-5.3.0 lib/scout/command/install.rb
scout-5.2.2 lib/scout/command/install.rb
scout-5.2.1 lib/scout/command/install.rb
scout-5.1.5 lib/scout/command/install.rb
scout-5.1.4 lib/scout/command/install.rb
scout-5.1.3 lib/scout/command/install.rb
scout-5.1.2 lib/scout/command/install.rb
scout-5.1.1 lib/scout/command/install.rb
scout-5.1.0 lib/scout/command/install.rb