Class: Amnesie::Persist::Iwd

Inherits:
Object
  • Object
show all
Defined in:
lib/amnesie/persist/iwd.rb

Instance Method Summary collapse

Constructor Details

#initializeIwd

Returns a new instance of Iwd.



7
8
9
10
# File 'lib/amnesie/persist/iwd.rb', line 7

def initialize
  @tmp = Tempfile.new("main.conf")
  apply
end

Instance Method Details

#applyObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/amnesie/persist/iwd.rb', line 12

def apply
  File.write(@tmp, iwd_conf)
  if ! File.exist? "/etc/iwd/main.conf" ||
      ! grep?("/etc/iwd/main.conf", /AddressRandomization/)
    puts "Add iwd/main.conf"
    Nito::Cp.new(@tmp.path, "/etc/iwd/main.conf")
  else
    puts "MAC random on iwd seem enable."
  end
end