3 # Mount or un-mount some filesystem
4 # XXX need way to detect current status?
5 # XXX should return result
6 # XXX client must force refresh:
7 # XXX can only deal with stuff in /etc/fstab
9 require './file-lib.pl';
10 $disallowed_buttons{'mount'} && &error($text{'ebutton'});
12 print "Content-type: text/plain\n\n";
13 if ($access{'ro'} || $access{'uid'}) {
14 # User is not allowed to mount
15 print "$text{'mount_eaccess'}\n";
20 $dir = &unmake_chroot($in{'dir'});
21 &foreign_require("mount", "mount-lib.pl");
22 @fstab = &mount::list_mounts();
23 @mtab = &mount::list_mounted();
24 ($fstab) = grep { $_->[0] eq $dir } @fstab;
27 print "$text{'mount_efstab'}\n";
30 ($mtab) = grep { $_->[0] eq $dir } @mtab;
33 # Attempt to un-mount now
34 $err = &mount::unmount_dir(@$mtab);
37 # Attempt to mount now
38 $err = &mount::mount_dir(@$fstab);