Sha256: 59f9d147ac438dc2848e6ebdc549c976921cea6ee621bc9b469faa61c554dd2d

Contents?: true

Size: 661 Bytes

Versions: 3

Compression:

Stored size: 661 Bytes

Contents

module VagrantPlugins
  module GuestOpenWrt
    class 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

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-unbundled-2.2.19.0 plugins/guests/openwrt/guest.rb
vagrant-unbundled-2.2.18.0 plugins/guests/openwrt/guest.rb
vagrant-unbundled-2.2.16.0 plugins/guests/openwrt/guest.rb