Arg encore un problème je viens me rendre compte que les scripts newdomain.sh et newuser.sh n'ajoute rien du tout à la bdd et la je pige vraiment pas, aucune erreur ne s'affiche mais rien ne sa fait (ni incrémentation ni créer des repertoires)
je remet les scripts concerner
<?
newdomain.sh
#!/bin/bash
#CONFIG
MYSQL_USER=postfix
MYSQL_PASS=votre_password
MYSQL_DB=maildb
POSTFIX_BASE_DIR=/var/spool/postfix/virtual/
##########################################
### DO NOT EDIT AFTER THIS ####
##########################################
echo -n "Enter the new domain name : "
read domain
echo -n "Enter the transport type ( ex : "virtual:" ) : "
read transport
echo -n "Enter the GID of this domain : "
read gid
if [ ! `mysql -u$MYSQL_USER -p$MYSQL_PASS --database=$MYSQL_DB -e"INSERT INTO
transport (domain, transport) VALUES ('$domain', '$transport');"` ]
then
echo "MySQL INSERT() was successfull"
if ! `mkdir $POSTFIX_BASE_DIR/$domain`
then
chgrp $gid $POSTFIX_BASE_DIR/$domain
chmod 770 $POSTFIX_BASE_DIR/$domain
echo "Content Directory created"
fi
fi
newuser.sh
#!/bin/bash
#CONFIG
MYSQL_USER=postfix
MYSQL_PASS=votre_password
MYSQL_DB=maildb
#WITH a trailing slash
POSTFIX_BASE_DIR=/var/spool/postfix/virtual/
##########################################
### DO NOT EDIT AFTER THIS ####
##########################################
echo -n "-> Enter the new username ( ex : glibersat) : "
read username
echo -e "n-> Enter the domain name ( ex : gnurus.org )... "
echo -e "tDetected domains :"
for domains in `ls $POSTFIX_BASE_DIR | sort`
do
echo -e "t(*) $domains"
done
echo -n "domain : "
read domain
echo -n -e "nEnter the password ( clear text ) : "
read password
echo -n -e "nEnter the real name ( ex : Guillaume Libersat ) : "
read realname
#Get domain GroupID
vgid=`ls -l /var/spool/postfix/virtual/ | grep $domain | awk '{ print $4 }'`
#Get a free UserID
vuid=`mysql -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DB -e"select MAX(uid)
from users" | tail -n1 | awk '{ print $1 }'`
vuid=$
echo -n -e "nEnter the GID of this domain (detected $vgid, hit Return to use it) : "
read r_gid
if $r_gid
then
vgid=$r_gid
fi
echo -n -e "nEnter the UID of this user (next free uid is $vuid, hit Return to use it) : "
read r_uid
if $r_uid
then
vuid=$r_uid
fi
if [ ! `mysql -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DB -e"INSERT INTO users
(id, address, crypt, clear, name, uid, gid, home, domain, maildir, imapok, bool1, bool2)
VALUES ('$username@$domain', '$username@$domain', ENCRYPT('$password'), '', '$realname', '$vuid',
'$vgid', '$POSTFIX_BASE_DIR', '$domain', '$POSTFIX_BASE_DIR$domain/$username/Maildir/', '1', '1', '1')"` ]
then
echo "MySQL INSERT() was successfull"
if ! `mkdir $POSTFIX_BASE_DIR/$domain/$username`
then
maildirmake $POSTFIX_BASE_DIR/$domain/$username/Maildir
chown $vuid:$vgid -R $POSTFIX_BASE_DIR/$domain/$username
chmod 770 $POSTFIX_BASE_DIR/$domain
echo "User Directory created"
fi
fi
?>