Sha256: bbbdc4d36565dc60f3a0a8d33e2fe3d1e4d5b6d0acd6b3e17e08a2aa324d178a
Contents?: true
Size: 1.15 KB
Versions: 51
Compression:
Stored size: 1.15 KB
Contents
module Helper class Smb attr_accessor :remote_path attr_accessor :local_path def samba_mount() Helper.validates_presence_of remote_path, "Samba remote_path not set" Helper.validates_presence_of local_path, "Samba mountpoint not set" $log.writer.debug "Mount samba share #{remote_path} to #{local_path}" # Check if already mounted (heuristik!) if File.stat('/').dev == File.stat(local_path).dev # Have to mount #### create mountpoint directory if not File.directory?(local_path) if not FileUtils.mkdir_p(local_path) $log.writer.error "Unable to create mountpoint directory #{local_path}" exit 1 end end shell_cmd = "/sbin/mount.cifs #{remote_path} #{local_path}" $log.writer.debug "Execute command: #{shell_cmd}" output = system shell_cmd if not output $log.writer.error "#{shell_cmd} failed" exit 1 end end end def samba_umount() Helper.validates_presence_of local_path, "Samba mountpoint not set" $log.writer.debug "Not yet implemented" end end end
Version data entries
51 entries across 51 versions & 1 rubygems