#!/usr/local/bin/bash

modulename=${1}

function makedir {
	if ! [ -d ${1} ]; then
		mkdir ${1}
	fi
}


d=${modulename}
makedir ${d}
d="${modulename}/templates"
makedir ${d}
d="${modulename}/configs"
makedir ${d}

f="${modulename}/configs/config.inc.php"
if ! [ -f ${f} ]; then
	echo -e "<?php \n\n?>" > ${f}
fi

f="${modulename}/templates/template.inc.html"
if ! [ -f ${f} ]; then
	echo -e "<!-- Begin: module -->\n\n<!-- End: module -->" > ${f}
fi

f="${modulename}/language.nl.php"
if ! [ -f ${f} ]; then
	echo -e "<?php\n\n\#$text[''] = '';\n?>" > ${f}
fi

f="${modulename}/handler.inc.php"
if ! [ -f ${f} ]; then
	echo -e "<?php\n\n?>" > ${f}
fi


