Sha256: 86237ab8a0c97f737424cd198b580248a691fae98c6790dcc2c0d09b5cd0e2b2

Contents?: true

Size: 959 Bytes

Versions: 26

Compression:

Stored size: 959 Bytes

Contents

module Mac::Exec
  include Beaker::CommandFactory

  def touch(file, abs=true)
    (abs ? '/usr/bin/touch' : 'touch') + " #{file}"
  end

  # Restarts the SSH service
  #
  # @return [Result] result of starting SSH service
  def ssh_service_restart
    launch_daemons_plist = '/System/Library/LaunchDaemons/ssh.plist'
    exec(Beaker::Command.new("launchctl unload #{launch_daemons_plist}"))
    exec(Beaker::Command.new("launchctl load #{launch_daemons_plist}"))
  end

  # Sets the PermitUserEnvironment setting & restarts the SSH service
  #
  # @api private
  # @return [Result] result of the command starting the SSH service
  #   (from {#ssh_service_restart})
  def ssh_permit_user_environment
    ssh_config_file = '/etc/sshd_config'
    ssh_config_file = '/private/etc/ssh/sshd_config' if self['platform'] =~ /osx-10\.*11/

    exec(Beaker::Command.new("echo '\nPermitUserEnvironment yes' >> #{ssh_config_file}"))
    ssh_service_restart()
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
beaker-2.49.0 lib/beaker/host/mac/exec.rb
beaker-2.48.1 lib/beaker/host/mac/exec.rb
beaker-2.48.0 lib/beaker/host/mac/exec.rb
beaker-2.47.1 lib/beaker/host/mac/exec.rb
beaker-2.47.0 lib/beaker/host/mac/exec.rb
beaker-2.46.0 lib/beaker/host/mac/exec.rb
beaker-2.45.0 lib/beaker/host/mac/exec.rb
beaker-2.44.0 lib/beaker/host/mac/exec.rb
beaker-2.43.0 lib/beaker/host/mac/exec.rb
beaker-2.42.0 lib/beaker/host/mac/exec.rb
beaker-2.41.0 lib/beaker/host/mac/exec.rb
beaker-2.40.0 lib/beaker/host/mac/exec.rb
beaker-2.39.0 lib/beaker/host/mac/exec.rb
beaker-2.38.1 lib/beaker/host/mac/exec.rb
beaker-2.38.0 lib/beaker/host/mac/exec.rb
beaker-2.37.0 lib/beaker/host/mac/exec.rb
beaker-2.36.0 lib/beaker/host/mac/exec.rb
beaker-2.35.0 lib/beaker/host/mac/exec.rb
beaker-2.34.0 lib/beaker/host/mac/exec.rb
beaker-2.33.0 lib/beaker/host/mac/exec.rb