| Server IP : 162.215.171.210 / Your IP : 216.73.216.51 Web Server : Apache System : Linux 162-215-171-210.bluehost.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : swansondentalgro ( 1070) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /scripts/ |
Upload File : |
#!/usr/bin/perl
use strict;
my $v = 1 if ($ARGV[0] =~ /^-(|-)(v|verbose)$/i);
my $location = "/backup/cpbackup/sbr";
if ( !-d $location ) {
print "SBnR folder not found.\n" if ( $v );;
exit 0;
}
my %mounts = ();
foreach my $mount ( `cat /proc/mounts` ) {
next if ($mount !~ m/^archivemount\s+(\S+)\s/);
$mounts{$1} = 1;
}
exit 0 and print "No SBnR mounts found.\n" if ( %mounts == () && $v );
my $user = '';
opendir(SBR, $location);
foreach my $dir ( readdir SBR ) {
next if ( $dir =~ m/^\./ );
$user = $1 if ($dir =~ m/^(\w+)\./);
print "Checking $user in $location/$dir/$user\n" if ( $v );
if ( $mounts{"$location/$dir/$user/homedir"} ) {
print "$dir/$user/homedir found, unmounting..." if ( $v );
system("umount -l $location/$dir/$user/homedir\n") == 0 or die "Can't unmount $location/$dir/$user/homedir\n";
print "done.\n" if ( $v );
}
if ( $mounts{"$location/$dir"} ) {
print "$dir found, unmounting..." if ( $v );
system("umount -l $location/$dir\n") == 0 or die "Can't unmount $location/$dir/$user/homedir\n";
print "done.\n" if ( $v );
}
}
closedir SBR;