Sha256: 917fa673b73060894a9455633cdada57f1323be69fb9dd628cba198a39de2da6

Contents?: true

Size: 848 Bytes

Versions: 27

Compression:

Stored size: 848 Bytes

Contents

#!/usr/bin/perl

=begin

Generates Ubuntu style module.load files.
 
./apache2_module_conf_generate.pl /usr/lib64/httpd/modules /etc/httpd/mods-available

ARGV[0] is the apache modules directory, ARGV[1] is where you want 'em.

=cut

use File::Find;

use strict;
use warnings;

die "Must have '/path/to/modules' and '/path/to/modules.load'"
  unless $ARGV[0] && $ARGV[1];

find(
  {
    wanted => sub {
      return 1 if $File::Find::name !~ /\.so$/;
      my $modfile = $_;
      $modfile =~ /(lib|mod_)(.+)\.so$/;
      my $modname  = $2;
      my $filename = "$ARGV[1]/$modname.load";
      unless ( -f $filename ) {
        open( FILE, ">", $filename ) or die "Cannot open $filename";
        print FILE "LoadModule " . $modname . "_module $File::Find::name\n";
        close(FILE);
      }
    },
    follow => 1,
  },
  $ARGV[0]
);

exit 0;

Version data entries

27 entries across 26 versions & 5 rubygems

Version Path
fast_food-0.1.2 chef/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
fast_food-0.1.1 chef/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
fast_food-0.1.0 chef/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
agile_solo-0.1.0 spec/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
vagrant-managed-servers-0.1.0 cookbooks/apache2/files/default/apache2_module_conf_generate.pl
vagrant-openstack-0.0.4 cookbooks/apache2/files/default/apache2_module_conf_generate.pl
vagrant-openstack-0.0.4 tmp/librarian/cache/source/chef/site/877777683730772c36b1e6a3fc3aa2c3/apache2/version-uri/a7ab7e6a4c7e38e585540241cf05880e/package/files/default/apache2_module_conf_generate.pl
poolparty-1.6.9 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.8 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.7 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.6 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.5 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.4 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.3 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.2 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.1 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.6.0 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.5.0 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.4.8 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
poolparty-1.4.7 examples/chef_cloud/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl