Sha256: e82cb5468c3f37b1c1210d939227f78f3cda3554262546d1a7ad630435a8307e
Contents?: true
Size: 709 Bytes
Versions: 13
Compression:
Stored size: 709 Bytes
Contents
module Kontena::Cli::Vpn class ConfigCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions 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
Version data entries
13 entries across 13 versions & 1 rubygems