[ Avaa Bypassed ]




Upload:

Command:

www-data@3.144.19.6: ~ $
#!/usr/bin/perl
# index.cgi
# Display a table of all volume groups and their physical and logical volumes.

require './lvm-lib.pl';
&ReadParse();

if (!&has_command("vgdisplay")) {
	&lvm_header();
	print &text('index_ecommands', "<tt>vgdisplay</tt>"),"<p>\n";
	&ui_print_footer("/", $text{'index'});
	exit;
	}
($lvm_version, $out) = &get_lvm_version();
if ($lvm_version && $lvm_version < 2) {
	# /proc/lvm doesn't exist in LVM 2
	if (!-d $lvm_proc) {
		system("modprobe lvm-mod >/dev/null 2>&1");
		}
	if (!-d $lvm_proc) {
		&lvm_header();
		print &text('index_emodule', "<tt>$lvm_proc</tt>",
				  "<tt>lvm-mod</tt>"),"<p>\n";
		&ui_print_footer("/", $text{'index'});
		exit;
		}
	}
if (!$lvm_version) {
	&lvm_header();
	print &text('index_eversion', "<tt>vgdisplay --version</tt>",
			  "<pre>$out</pre>"),"<p>\n";
	&ui_print_footer("/", $text{'index'});
	exit;
	}
&lvm_header();

@vgs = &list_volume_groups();
if (@vgs) {
	# Start tabs for volume groups, physical volumes and logical volumes
	@tabs = ( [ 'vgs', $text{'index_vgs'}, 'index.cgi?mode=vgs' ],
		  [ 'pvs', $text{'index_pvs'}, 'index.cgi?mode=pvs' ],
		  [ 'lvs', $text{'index_lvs'}, 'index.cgi?mode=lvs' ] );
	print &ui_tabs_start(\@tabs, "mode", $in{'mode'} || 'vgs', 1);

	# Show volume groups
	print &ui_tabs_start_tab("mode", "vgs");
	print $text{'index_vgsdesc'},"<p>\n";
	@vgs = sort { $a->{'number'} <=> $b->{'number'} } @vgs;
	@links = ( &ui_link("edit_vg.cgi",$text{'index_add'}) );
	if ($config{'show_table'}) {
		# As table
		print &ui_links_row(\@links);
		print &ui_columns_start([ $text{'index_vgname'},
					  $text{'index_vgsize'},
					  $text{'index_vgtotal'},
					  $text{'index_vgtotal2'} ], 100);
		foreach $v (@vgs) {
			print &ui_columns_row([
			  &ui_link(
			    "edit_vg.cgi?vg=".&urlize($v->{'name'}),
			    &html_escape($v->{'name'})),
			  &nice_size($v->{'size'}*1024),
			  &text('lv_petotals', $v->{'pe_alloc'},
					       $v->{'pe_total'}),
			  &text('lv_petotals',
			    &nice_size($v->{'pe_alloc'}*$v->{'pe_size'}*1024),
			    &nice_size($v->{'pe_total'}*$v->{'pe_size'}*1024))
			  ]);
			}
		print &ui_columns_end();
		}
	else {
		# As icons
		print &ui_links_row(\@links);
		foreach $v (@vgs) {
			push(@vgicons, "edit_vg.cgi?vg=".&urlize($v->{'name'}));
			push(@vgtitles, &html_escape($v->{'name'}).
					"<br>".&nice_size($v->{'size'}*1024));
			push(@vglinks, "images/vg.gif");
			}
		&icons_table(\@vgicons, \@vgtitles, \@vglinks);
		}
	print &ui_links_row(\@links);
	print &ui_tabs_end_tab();

	# Show physical volumes
	print &ui_tabs_start_tab("mode", "pvs");
	print $text{'index_pvsdesc'},"<p>\n";
	foreach $v (@vgs) {
		push(@allpvs, &list_physical_volumes($v->{'name'}));
		}
	@allpvs = sort { $a->{'name'} cmp $b->{'name'} } @allpvs;
	@links = ( );
	foreach $v (@vgs) {
		push(@links, &ui_link("edit_pv.cgi?vg=".&urlize($v->{'name'}),
				      &text('index_addpv2', $v->{'name'})));
		}
	if (!@allpvs) {
		# None yet
		print "<b>$text{'index_nopvs2'}</b><p>\n";
		}
	elsif ($config{'show_table'}) {
		# Show table of PVs
		print &ui_links_row(\@links);
		print &ui_columns_start([ $text{'index_pvname'},
					  $text{'index_pvvg'},
					  $text{'index_pvsize'},
					  $text{'index_pvtotal'},
					  $text{'index_pvtotal2'} ], 100);
		foreach $p (@allpvs) {
			($v) = grep { $_->{'name'} eq $p->{'vg'} } @vgs;
			print &ui_columns_row([
			  &ui_link(
			    "edit_pv.cgi?vg=".&urlize($v->{'name'}).
		            "&pv=".&urlize($p->{'name'}), $p->{'name'}),
			  $v->{'name'},
			  &nice_size($p->{'size'}*1024),
			  &text('lv_petotals', $p->{'pe_alloc'},
					       $p->{'pe_total'}),
			  &text('lv_petotals',
			    &nice_size($p->{'pe_alloc'}*$p->{'pe_size'}*1024),
			    &nice_size($p->{'pe_total'}*$p->{'pe_size'}*1024)),
			  ]);
			}
		print &ui_columns_end();
		}
	else {
		# Show PV icons
		print &ui_links_row(\@links);
		foreach $p (@allpvs) {
			($v) = grep { $_->{'name'} eq $p->{'vg'} } @vgs;
			push(@pvicons, "edit_pv.cgi?vg=".&urlize($v->{'name'}).
				       "&pv=".&urlize($p->{'name'}));
			push(@pvtitles, &html_escape($p->{'name'}).
					"<br>".&nice_size($p->{'size'}*1024));
			push(@pvlinks, "images/vg.gif");
			}
		&icons_table(\@pvicons, \@pvtitles, \@pvlinks);
		}
	print &ui_links_row(\@links);
	print &ui_tabs_end_tab();

	# Show logical volumes
	print &ui_tabs_start_tab("mode", "lvs");
	print $text{'index_lvsdesc'},"<p>\n";
	foreach $v (@vgs) {
		push(@alllvs, &list_logical_volumes($v->{'name'}));
		}
	@alllvs = sort { $a->{'name'} cmp $b->{'name'} } @alllvs;
	@links = ( );
	foreach $v (@vgs) {
		push(@links, &ui_link("edit_lv.cgi?vg=".&urlize($v->{'name'}),
				      &text('index_addlv2', $v->{'name'})));
		@lvsin = grep { $_->{'vg'} eq $v->{'name'} } @alllvs;
		if (@lvsin) {
			push(@links, &ui_link(
			    "edit_lv.cgi?vg=".&urlize($v->{'name'})."&snap=1",
			    &text('index_addlv2s', $v->{'name'})));
			push(@links, &ui_link(
			    "thin_form.cgi?vg=".&urlize($v->{'name'}),
			    &text('index_addlv3', $v->{'name'})));
			}
		push(@links, &ui_link("raid_form.cgi?vg=".&urlize($v->{'name'}),
				      &text('index_addlv4', $v->{'name'})));
		}
	if (!@alllvs) {
		# None yet
		print "<b>$text{'index_nolvs2'}</b><p>\n";
		}
	elsif ($config{'show_table'}) {
		# Show table of LVs
		print &ui_links_row(\@links);
		print &ui_columns_start([ $text{'index_lvname'},
					  $text{'index_lvvg'},
					  $text{'index_lvsize'},
					  $text{'index_lvused'},
					  $text{'index_lvuse'} ], 100);
		foreach $l (@alllvs) {
			($v) = grep { $_->{'name'} eq $l->{'vg'} } @vgs;
			my @thinc;
			if ($l->{'thin'}) {
				@thinc = grep { $_->{'thin_in'} eq
						$l->{'name'} } @alllvs;
				}
			if ($lv->{'is_snap'}) {
				($snapof) = grep {
					$_->{'size'} == $l->{'size'} &&
					$_->{'vg'} eq $l->{'vg'} &&
					$_->{'has_snap'} } @alllvs;
				}
			else {
				$snapof = undef;
				}
			@stat = &device_status($l->{'device'});
			$usedmsg = "";
			if (@stat[2]) {
				($total, $free) = &mount::disk_space(
					$stat[1], $stat[0]);
				if ($total) {
					$usedmsg = &nice_size(
						($total-$free)*1024);
					}
				}
			print &ui_columns_row([
			  &ui_link(
			    "edit_lv.cgi?vg=".&urlize($v->{'name'}).
		            "&lv=".&urlize($l->{'name'}),
			    $l->{'name'}),
			  $v->{'name'},
			  &nice_size(($l->{'cow_size'} || $l->{'size'})*1024),
			  $usedmsg,
			  (@stat ? &device_message(@stat) :
			   $l->{'thin'} ? &text('index_thin', scalar(@thinc)) :
					  undef).
			  ($snap ? " ".&text('index_snapof', $snap->{'name'})
				 : ""),
			  ]);
			}
		print &ui_columns_end();
		}
	else {
		# Show LV icons
		print &ui_links_row(\@links);
		foreach $l (@alllvs) {
			($v) = grep { $_->{'name'} eq $l->{'vg'} } @vgs;
			push(@lvicons, "edit_lv.cgi?vg=".&urlize($v->{'name'}).
				       "&lv=".&urlize($l->{'name'}));
			push(@lvtitles, &html_escape($l->{'name'}).
					"<br>".&nice_size(($l->{'cow_size'} || $l->{'size'})*1024));
			push(@lvlinks, "images/lv.gif");
			}
		&icons_table(\@lvicons, \@lvtitles, \@lvlinks);
		}
	print &ui_links_row(\@links);
	print &ui_tabs_end_tab();

	print &ui_tabs_end(1);
	}
else {
	print "<b>$text{'index_none'}</b> <p>\n";
	@tab = &list_lvmtab();
	if (@tab) {
		# Maybe LVM needs to be re-started
		print &text('index_init', "init.cgi"),"<p>\n";
		}
	print &ui_links_row([
		&ui_link("edit_vg.cgi",$text{'index_add'}) ]);
	}

&ui_print_footer("/", $text{'index'});

sub lvm_header
{
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
	&help_search_link("lvm", "man", "doc", "google"), undef, undef,
	$lvm_version ? &text('index_version', $lvm_version) : undef);
}


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 3.07 KB 0644
backup_config.pl File 599 B 0744
cgi_args.pl File 756 B 0755
config File 40 B 0644
config.info File 98 B 0644
config.info.ca File 118 B 0644
config.info.de File 110 B 0644
config.info.fr File 123 B 0644
config.info.ms File 66 B 0644
config.info.nl File 63 B 0644
config.info.no File 58 B 0644
edit_lv.cgi File 10.44 KB 0755
edit_pv.cgi File 2.48 KB 0755
edit_vg.cgi File 1.5 KB 0755
feedback_files.pl File 155 B 0755
index.cgi File 7.42 KB 0755
init.cgi File 448 B 0755
install_check.pl File 517 B 0755
log_parser.pl File 585 B 0755
lvm-lib.pl File 26.52 KB 0755
mkfs.cgi File 773 B 0755
mkfs_form.cgi File 715 B 0755
module.info File 203 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 128 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 253 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 203 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 248 B 0644
module.info.ca File 123 B 0644
module.info.ca.auto File 12 B 0644
module.info.cs File 35 B 0644
module.info.cs.auto File 107 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 135 B 0644
module.info.de File 125 B 0644
module.info.de.auto File 12 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 233 B 0644
module.info.es File 37 B 0644
module.info.es.auto File 114 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 134 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 167 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 143 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 155 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 180 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 144 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 159 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 134 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 178 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 143 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 131 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 142 B 0644
module.info.ms File 130 B 0644
module.info.ms.auto File 12 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 142 B 0644
module.info.nl File 34 B 0644
module.info.nl.auto File 104 B 0644
module.info.no File 36 B 0644
module.info.no.auto File 99 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 150 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 145 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 154 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 143 B 0644
module.info.ru File 65 B 0644
module.info.ru.auto File 149 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 147 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 149 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 132 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 272 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 155 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 213 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 188 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 176 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 100 B 0644
module.info.zh_TW File 30 B 0644
module.info.zh_TW.auto File 82 B 0644
prefs.info File 18 B 0644
pvmove.cgi File 923 B 0755
raid_create.cgi File 2.85 KB 0755
raid_form.cgi File 2.3 KB 0755
save_lv.cgi File 7.47 KB 0755
save_pv.cgi File 1.95 KB 0755
save_vg.cgi File 1.85 KB 0755
thin_create.cgi File 913 B 0755
thin_form.cgi File 1.13 KB 0755