Sha256: 4f626ab198be34f024f763c6d1c34e69d80ca76822ea492db276e36a8ce39964
Contents?: true
Size: 756 Bytes
Versions: 9
Compression:
Stored size: 756 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 << "script-security 2 system\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
9 entries across 9 versions & 1 rubygems