Sha256: 7c987ccfa93e01d617e7381fa9b50681a026f8cafcdd50dd9312eef35d37807d

Contents?: true

Size: 1021 Bytes

Versions: 67

Compression:

Stored size: 1021 Bytes

Contents

#!/bin/sh -e

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

if [ -z $1 ]; then
        echo "Which site would you like to enable?"
        echo -n "Your choices are: "
        ls $SYSCONFDIR/sites-available/* | \
        sed -e "s,$SYSCONFDIR/sites-available/,,g" | xargs echo
        echo -n "Site name? "
        read SITENAME
else
        SITENAME=$1
fi

if [ $SITENAME = "default" ]; then
        PRIORITY="000"
fi

if [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
     -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
        echo "This site is already enabled!"
        exit 0
fi

if ! [ -e $SYSCONFDIR/sites-available/$SITENAME ]; then
        echo "This site does not exist!"
        exit 1
fi

if [ $SITENAME = "default" ]; then
        ln -sf $SYSCONFDIR/sites-available/$SITENAME \
               $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
else
        ln -sf $SYSCONFDIR/sites-available/$SITENAME $SYSCONFDIR/sites-enabled/$SITENAME
fi

echo "Site $SITENAME installed; reload apache to enable."

Version data entries

67 entries across 67 versions & 3 rubygems

Version Path
auser-poolparty-1.3.13 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.14 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.15 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.16 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.17 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.2 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.3 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.4 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.5 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.6 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.7 vendor/chef/apache2/templates/default/a2ensite.erb
auser-poolparty-1.3.8 vendor/chef/apache2/templates/default/a2ensite.erb
fairchild-poolparty-1.1.4 vendor/chef/apache2/templates/default/a2ensite.erb
fairchild-poolparty-1.1.5 vendor/chef/apache2/templates/default/a2ensite.erb
fairchild-poolparty-1.2.12 vendor/chef/apache2/templates/default/a2ensite.erb
fairchild-poolparty-1.3.17 vendor/chef/apache2/templates/default/a2ensite.erb
fairchild-poolparty-1.3.5 vendor/chef/apache2/templates/default/a2ensite.erb
poolparty-1.6.9 examples/chef_cloud/chef_repo/cookbooks/apache2/templates/default/a2ensite.erb
poolparty-1.6.8 examples/chef_cloud/chef_repo/cookbooks/apache2/templates/default/a2ensite.erb
poolparty-1.6.7 examples/chef_cloud/chef_repo/cookbooks/apache2/templates/default/a2ensite.erb