<commit_before>module Kontena::Cli::Vpn
  class ConfigCommand < Clamp::Command
    include Kontena::Cli::Common

    def execute
      require_api_url
      payload = {cmd: ['/usr/local/bin/ovpn_getclient', 'KONTENA_VPN_CLIENT']}
      stdout, stderr = client(require_token).post("containers/#{current_grid}/vpn/vpn-1/exec", payload)
      puts stdout
    end
  end
end
<commit_msg>append resolv-conf lines in linux<commit_after>module Kontena::Cli::Vpn
  class ConfigCommand < Clamp::Command
    include Kontena::Cli::Common

    def execute
      require 'rbconfig'
      require_api_url
      payload = {cmd: ['/usr/local/bin/ovpn_getclient', 'KONTENA_VPN_CLIENT']}
      stdout, stderr = client(require_token).post("containers/#{current_grid}/vpn/vpn-1/exec", payload)
      if linux?
        stdout << "\n"
        stdout << "up /etc/openvpn/update-resolv-conf\n"
        stdout << "down /etc/openvpn/update-resolv-conf\n"
      end
      puts stdout
    end

    # @return [Boolean]
    def linux?
      host_os = RbConfig::CONFIG['host_os']
      host_os.include?('linux')
    end
  end
end

{'fraction_non_alphanumeric': 0.1284153005464481, 'fraction_numerical': 0.0018214936247723133, 'mean_word_length': 3.1161048689138577, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2260273', 'n_tokens_mistral': 388, 'n_tokens_neox': 382, 'n_words': 71}