2009-04-03 16:27:49 +00:00
|
|
|
#!/usr/bin/ruby
|
2009-09-19 23:51:18 +00:00
|
|
|
# vim: set ts=2 sw=2 :
|
2009-04-03 16:27:49 +00:00
|
|
|
|
|
|
|
require 'config'
|
2009-05-22 21:01:23 +00:00
|
|
|
require 'map'
|
|
|
|
|
|
|
|
module SshfsMapper
|
|
|
|
class SshfsMapper
|
|
|
|
def initialize()
|
|
|
|
@maps = nil
|
|
|
|
puts "-- sshfs-mapper --"
|
|
|
|
conf = Config.new
|
|
|
|
conf.parseCmd ARGV
|
|
|
|
@maps = conf.parseFile
|
|
|
|
puts conf
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def run()
|
|
|
|
if @maps.nil? then
|
|
|
|
return
|
|
|
|
end
|
2009-09-19 23:51:18 +00:00
|
|
|
@maps.each do |map|
|
|
|
|
map.connect()
|
2009-05-22 21:01:23 +00:00
|
|
|
end
|
|
|
|
puts "--run"
|
|
|
|
end
|
2009-04-03 16:27:49 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-05-22 21:01:23 +00:00
|
|
|
app = SshfsMapper::SshfsMapper.new
|
|
|
|
app.run
|
2009-04-03 16:27:49 +00:00
|
|
|
|