module Synco::LinuxDisk
Depending on how you have things set up, you'll probably want to add %wheel ALL=(root) NOPASSWD: /bin/mount %wheel ALL=(root) NOPASSWD: /bin/umount to /etc/sudoers.d/synco
Public Class Methods
available?(disk_name)
click to toggle source
# File lib/synco/disk.rb, line 27 def self.available?(disk_name) File.exist?("/dev/disk/by-label/#{disk_name}") end
mount(path, disk_name = nil)
click to toggle source
# File lib/synco/disk.rb, line 31 def self.mount(path, disk_name = nil) if disk_name system("sudo", "mount", "-L", disk_name, path) else system("sudo", "mount", path) end end
unmount(path)
click to toggle source
# File lib/synco/disk.rb, line 39 def self.unmount(path) system("sudo", "umount", path) end