Sha256: 7b180f0326825d4bf26058ed54fa77cc2856a667ed0512d25d29b998ca296e4b

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

#!/bin/sh -e

SYSCONFDIR='<%= node['apache']['dir'] %>'

if [ -z $1 ]; then
        echo "Which module would you like to enable?"
        echo -n "Your choices are: "
        ls $SYSCONFDIR/mods-available/*.load | \
        sed -e "s,$SYSCONFDIR/mods-available/,,g" | sed -e 's/\.load$//g;' | xargs echo
        echo -n "Module name? "
        read MODNAME
else
        MODNAME=$1
fi

#figure out if we're on a prefork or threaded mpm
if [ -x /usr/sbin/apache2 ]; then
        PREFORK=`/usr/sbin/apache2 -l | grep prefork || true`
fi

if [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load -a -e $SYSCONFDIR/mods-enabled/$MODNAME.conf ]; then
        echo "This module is already enabled!"
        exit 0 
fi

if ! [ -e $SYSCONFDIR/mods-available/$MODNAME.load ]; then
        echo "This module does not exist!"
        exit 1
fi

for i in conf load; do 
        if [ -e $SYSCONFDIR/mods-available/$MODNAME.$i -a ! -e $SYSCONFDIR/mods-enabled/$MODNAME.$i ]; then
        ln -sf $SYSCONFDIR/mods-available/$MODNAME.$i $SYSCONFDIR/mods-enabled/$MODNAME.$i;
        fi
done

echo "Module $MODNAME installed; reload apache to enable."

Version data entries

7 entries across 6 versions & 4 rubygems

Version Path
fast_food-0.1.2 chef/cookbooks/apache2/templates/default/a2enmod.erb
fast_food-0.1.1 chef/cookbooks/apache2/templates/default/a2enmod.erb
fast_food-0.1.0 chef/cookbooks/apache2/templates/default/a2enmod.erb
agile_solo-0.1.0 spec/chef_repo/cookbooks/apache2/templates/default/a2enmod.erb
vagrant-managed-servers-0.1.0 cookbooks/apache2/templates/default/a2enmod.erb
vagrant-openstack-0.0.4 tmp/librarian/cache/source/chef/site/877777683730772c36b1e6a3fc3aa2c3/apache2/version-uri/a7ab7e6a4c7e38e585540241cf05880e/package/templates/default/a2enmod.erb
vagrant-openstack-0.0.4 cookbooks/apache2/templates/default/a2enmod.erb