module AmdgpuFan::SysWrite

A mixin to help with writing to system files

Private Instance Methods

sudo_write(file_path, value) click to toggle source

Write to a system file with elevated priviledges.

# File lib/amdgpu_fan/mixin/sys_write.rb, line 10
def sudo_write(file_path, value)
  `echo "#{value}" | sudo tee #{file_path}`
end