#format
#script domain.com username foldername password sizeinMB
echo -e "Chking if domin name exist "
if [ -d /websites/"$1" ]; then
echo -e "the domin exist"
echo -e "chking to see if user exist"
if [ "`cat /usr/local/pureftpd/etc/pureftpd.passwd | sed 's/:/ /g' |awk '{print $1}' |sed -n "/${2}/P"`" != "$2" ]; then
echo -e "chking to see if dir exist"
if [ -d /websites/"$1"/"$3" ]; then
echo -e "the dir $3 exist"
echo -e "adding ftp user"
(echo $4; echo $4 ) | /usr/local/pureftpd/bin/pure-pw useradd "$2" -f /usr/local/pureftpd/etc/pureftpd.passwd -u "$2" -d /websites/"$1"/"$3" -m
else
echo -e "the dir $3 does not exist"
fi
else
echo -e "the user is all read present"
fi
else
echo -e "the domin does not exist"
fi
--
No comments:
Post a Comment