- !/bin/bash
if "$#" -lt 3 ; then echo "" echo "Usage : addvirtual dominio utente database" echo "" exit 0 fi
if -f /etc/apache2/conf.d/vhost.d/www.$1.conf
; then
echo ""
echo "Il virtual server esiste gia'"
echo ""
exit 0
fi
if -d /home/www/www.$1
; then
echo ""
echo "La directory sotto /home/www esiste gia'"
echo ""
exit 0
fi
if ! -f /opt/template/virtual.conf
; then
echo ""
echo "Il file /opt/template/virtual.conf non esiste"
echo ""
exit 0
fi
if -f /etc/apache2/conf.d/vhost.xml/$1.xml
; then
echo ""
echo "Il file /etc/apache2/conf.d/vhost.xml/$1.xml esiste gia'"
echo ""
exit 0
fi
if ! -f /opt/template/template.xml
; then
echo ""
echo "Il file /opt/template/template.xml non esiste"
echo ""
exit 0
fi
- Controllo se l'utente esiste
- Crea il file di configurazione per http
- Crea il file di configurazione per xml
- Crea le directory di lavoro
- Crea il file di configurazione per Webalizer