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
|
|
|
|
2010-01-24 18:30:15 +00:00
|
|
|
$DEBUG = true
|
|
|
|
$VERBOSE = true
|
|
|
|
|
2011-03-07 23:25:47 +00:00
|
|
|
require 'sshfs-mapper/config'
|
|
|
|
require 'sshfs-mapper/map'
|
2009-05-22 21:01:23 +00:00
|
|
|
|
|
|
|
module SshfsMapper
|
|
|
|
class SshfsMapper
|
2011-03-07 23:25:47 +00:00
|
|
|
def initialize
|
2009-12-14 23:56:06 +00:00
|
|
|
@active_maps = nil
|
2009-05-22 21:01:23 +00:00
|
|
|
puts "-- sshfs-mapper --"
|
|
|
|
conf = Config.new
|
2011-03-07 23:25:47 +00:00
|
|
|
conf.parse_cmd_line ARGV
|
|
|
|
@active_maps = conf.parse_file
|
2009-05-22 21:01:23 +00:00
|
|
|
puts conf
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-03-07 23:25:47 +00:00
|
|
|
def run
|
2009-12-14 23:56:06 +00:00
|
|
|
if @active_maps.nil? then
|
2009-05-22 21:01:23 +00:00
|
|
|
return
|
|
|
|
end
|
2009-12-14 23:56:06 +00:00
|
|
|
@active_maps.each do |map|
|
2009-09-19 23:51:18 +00:00
|
|
|
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
|
|
|
|
2011-03-07 23:25:47 +00:00
|
|
|
|