Class: ProconBypassMan::WriteDeviceIdCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/commands/write_device_id_command.rb

Class Method Summary collapse

Class Method Details

.executeString

Returns:

  • (String)


3
4
5
6
7
8
9
10
11
# File 'lib/procon_bypass_man/commands/write_device_id_command.rb', line 3

def self.execute
  path = "#{ProconBypassMan.root}/device_id"
  if(sid = File.read(path))
    return sid
  end
rescue Errno::ENOENT
  File.write(path, "m_#{SecureRandom.uuid}")
  return SecureRandom.uuid
end