#!/bin/bash
TOPLEVEL_DIR='/home/nginx/domains'
for domain in $(ls $TOPLEVEL_DIR)
do
if [ ! -d "/usr/local/nginx/conf/autoprotect/${domain}" ]
then
mkdir -p "/usr/local/nginx/conf/autoprotect/${domain}"
fi
if [ ! -f /usr/local/nginx/conf/autoprotect/"${domain}"/autoprotect-"${domain}".conf ]
then
touch /usr/local/nginx/conf/autoprotect/"${domain}"/autoprotect-"${domain}".conf
fi
done