#!/opt/td-agent/bin/ruby
ENV["GEM_HOME"]="/opt/td-agent/lib/ruby/gems/3.1.0/"
ENV["GEM_PATH"]="/opt/td-agent/lib/ruby/gems/3.1.0/"
ENV["FLUENT_CONF"]="/etc/td-agent/td-agent.conf"
ENV["FLUENT_PLUGIN"]="/etc/td-agent/plugin"
ENV["FLUENT_SOCKET"]="/var/run/td-agent/td-agent.sock"
if ARGV.include?("--version")
  require "/opt/td-agent/share/config"
  Dir.glob("/opt/td-agent/lib/ruby/**/gems/**/fluent/version.rb").each do |v|
    require v.delete_suffix(".rb")
  end
  puts "td-agent #{PACKAGE_VERSION} fluentd #{Fluent::VERSION} (#{FLUENTD_REVISION})"
  exit 0
end
load "/opt/td-agent/bin/fluentd"
