HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/local/usermin-1.823/file/mount.cgi
#!/usr/bin/perl
# Mount or un-mount some filesystem

require './file-lib.pl';
$disallowed_buttons{'mount'} && &error($text{'ebutton'});
&ReadParse();
print "Content-type: text/plain\n\n";

# Get current status
$dir = &unmake_chroot($in{'dir'});
&foreign_require("usermount", "usermount-lib.pl");
@fstab = &usermount::list_mounts();
@mtab = &usermount::list_mounted();
($fstab) = grep { $_->[0] eq $dir } @fstab;
if (!$fstab) {
	# Doesn't exist!
	print "$text{'mount_efstab'}\n";
	exit;
	}
($mtab) = grep { $_->[0] eq $dir } @mtab;

if ($mtab) {
	# Attempt to un-mount now
	$cmd = "umount ".quotemeta($dir);
	}
else {
	# Attempt to mount now
	$cmd = "mount ".quotemeta($dir);
	}
$out = `$cmd </dev/null 2>&1`;
if ($?) {
	$out =~ s/\n/ /g;
	print $out,"\n";
	}
else {
	print "\n";
	}