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