]> git.proxmox.com Git - pve-common.git/commitdiff
This function checks if a moutpoint is mounted
authorWolfgang Link <w.link@proxmox.com>
Thu, 3 Sep 2015 06:52:16 +0000 (08:52 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 3 Sep 2015 08:03:39 +0000 (10:03 +0200)
src/PVE/ProcFSTools.pm

index fea539a563f1f6e8eee1770e3999fbbb962e1f87..467069430c6a7baa927a4975ae3e9159925f3abe 100644 (file)
@@ -288,6 +288,18 @@ sub read_proc_mounts {
     return PVE::Tools::file_get_contents("/proc/mounts");
 }
 
+sub is_mounted {
+    my ($mountpoint) = @_;
+
+    my $mountdata = read_proc_mounts();
+
+    if ($mountdata =~ m/\s$mountpoint\s/) {
+       return 1;
+    } else {
+       return 0;
+    }
+}
+
 sub read_proc_net_ipv6_route {
     my $filename = "/proc/net/ipv6_route";