From: Wolfgang Link Date: Thu, 3 Sep 2015 06:52:16 +0000 (+0200) Subject: This function checks if a moutpoint is mounted X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=115c838376b7ef67913542827a65b54e80d8c6c6 This function checks if a moutpoint is mounted --- diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index fea539a..4670694 100644 --- a/src/PVE/ProcFSTools.pm +++ b/src/PVE/ProcFSTools.pm @@ -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";