#!<> use INSTALL::common; use INSTALL::global; use INSTALL::parameter; use INSTALL::os; use INSTALL::webserver; use strict; my $pParameters = \%INSTALL::parameter::variables; #============================================================================== #------------------------ Default global values #============================================================================== $pParameters->{asphome} = "<>"; $pParameters->{com_layer} = "<>"; INSTALL::common::set_standard_globals; my $pGlobals = \%INSTALL::global::variables; my $pOS = \%INSTALL::os::Details; sub usage { printf("usage: list-webservers [refresh | all]\n"); exit(1); } #============================================================================== #------------------------ Validate all the required parameters. #============================================================================== my %PARAM_REQUIREMENTS = ( OPTIONAL => [ 'refresh', 'all' ] ); if (boolean_value($pParameters->{'--help'})) { usage(); } unless(INSTALL::parameter::verify(%PARAM_REQUIREMENTS)) { exit(1); } if ((@ARGV > 1) || ((@ARGV == 1) && (not grep { $ARGV[0] =~ /^$_$/} @{$PARAM_REQUIREMENTS{OPTIONAL}}))) { usage(); } if (exists $pParameters->{refresh}) { INSTALL::webserver::build_server_cache("/"); } my @valid_servers; foreach my $pServerStats (INSTALL::webserver::load_server_links) { unless(exists $pServerStats->{engine_dir}) { # If not a cross link. if (exists $pParameters->{all}) { push @valid_servers, $pServerStats->{webserver_conf}; } elsif (($pServerStats->{webserver_type} !~ /Apache/i) || boolean_value($pServerStats->{webserver_dso})) { # We only list DSO Apache webservers. push @valid_servers, $pServerStats->{webserver_conf}; } } } print join("\n",@valid_servers),"\n"; exit(0);