Sha256: 392dc93fde58780aaa71a1c2ca141143685e0c22f04948f43ec5cd7706ebad6a

Contents?: true

Size: 1021 Bytes

Versions: 12

Compression:

Stored size: 1021 Bytes

Contents

#!/bin/sh -e

SYSCONFDIR='<%= node['nginx']['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 nginx to enable."

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
from-scratch-0.7.0 cookbooks/nginx/templates/default/nxensite.erb
from-scratch-0.6.0 cookbooks/nginx/templates/default/nxensite.erb
from-scratch-0.5.0 cookbooks/nginx/templates/default/nxensite.erb
agile_solo-0.1.0 spec/chef_repo/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.8 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.7 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.6 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.5 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.4 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.3 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.2 lib/cookbooks/nginx/templates/default/nxensite.erb
server_maint-0.0.1 lib/cookbooks/nginx/templates/default/nxensite.erb