HEX
Server: Apache/2.2.15 (CentOS)
System: Linux ip-10-0-2-146.eu-west-1.compute.internal 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64
User: root (0)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //proc/8235/cwd/opt/codedeploy-agent/bin/codedeploy-agent
#!/usr/bin/env ruby

$:.unshift File.join(File.dirname(File.expand_path('..', __FILE__)), 'lib')

ruby_versions = ["2.7", "2.6", "2.5", "2.4", "2.3", "2.2", "2.1", "2.0"]
actual_ruby_version = RUBY_VERSION.split('.').map{|s|s.to_i}
left_bound = '2.0.0'.split('.').map{|s|s.to_i}
ruby_bin = nil

if (actual_ruby_version <=> left_bound) > -1
  ruby_bin = "ruby"
else
  ruby_versions.each do |i|
    ruby_dir = "/usr/bin/ruby#{i}"
    if File.file?(ruby_dir)
      ruby_bin = ruby_dir
      break
    end
  end
end

if ruby_bin
  exec("#{ruby_bin} #{File.join(File.expand_path(File.dirname(__FILE__)), "../lib/codedeploy-agent.rb")} #{ARGV.join(' ')}")
end

STDERR.puts "No supported ruby version found. Code Deploy Host Agent supports Ruby version 2.0.x and greater."
exit(1)