Revision 22909,
649 bytes
checked in by tabbott, 16 years ago
(diff) |
Initial import of debathena-afuse-automounter.
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | use strict; |
---|
3 | use warnings; |
---|
4 | |
---|
5 | my ($mountpoint, $name) = @ARGV; |
---|
6 | my %filsys; |
---|
7 | open(HESINFO, '-|', 'hesinfo', '--', $name, 'filsys') or die "can't exec hesinfo: $!"; |
---|
8 | while (<HESINFO>) { |
---|
9 | chomp; |
---|
10 | my %f; @f{qw(type path rw mount order)} = split / /; |
---|
11 | %filsys = %f if (($f{order} || 9999) <= ($filsys{order} || 9999)); |
---|
12 | } |
---|
13 | close(HESINFO); |
---|
14 | %filsys or die "no locker $name"; |
---|
15 | $filsys{type} eq 'AFS' or die "bad type $filsys{type} for locker $name"; |
---|
16 | $filsys{path} =~ m|^/afs/| or die "bad path $filsys{path} for locker $name"; |
---|
17 | rmdir($mountpoint); |
---|
18 | symlink($filsys{path}, $mountpoint) or die "can't symlink $mountpoint to $filsys{path}: $!"; |
---|
Note: See
TracBrowser
for help on using the repository browser.