Sha256: 7a1046da638598b023ce80743c7f6e3cdd0590056cf16722f7e100f34d81a03d

Contents?: true

Size: 691 Bytes

Versions: 4

Compression:

Stored size: 691 Bytes

Contents

module VagrantPlugins
  module GuestOpenWrt
    class Guest < Vagrant.plugin("2", :guest)
      # Name used for guest detection
      GUEST_DETECTION_NAME = "openwrt".freeze

      def detect?(machine)
        machine.communicate.test <<~EOH
          if test -e /etc/openwrt_release; then
            exit
          fi
          if test -r /etc/os-release; then
            source /etc/os-release && test 'x#{self.class.const_get(:GUEST_DETECTION_NAME)}' = "x$ID" && exit
          fi
          if test -r /etc/banner; then
            cat /etc/banner | grep -qi '#{self.class.const_get(:GUEST_DETECTION_NAME)}' && exit
          fi
          exit 1
        EOH
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/guests/openwrt/guest.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/guests/openwrt/guest.rb
vagrant-unbundled-2.3.3.0 plugins/guests/openwrt/guest.rb
vagrant-unbundled-2.3.2.0 plugins/guests/openwrt/guest.rb