38 lines
698 B
Bash
38 lines
698 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
server="192.168.230.4"
|
||
|
|
||
|
pass=`pwgen -N 1`
|
||
|
MYSQL_pass=`pwgen -N 1`
|
||
|
|
||
|
useradd -m $1
|
||
|
echo $1:$pass| chpasswd
|
||
|
echo "User created"
|
||
|
echo "Name: $1"
|
||
|
echo "Pass: $pass"
|
||
|
|
||
|
www="/home/$1/public_html"
|
||
|
mkdir $www
|
||
|
chown $1:$1 $www -R
|
||
|
chmod 777 -R $www
|
||
|
echo "public_html created"
|
||
|
|
||
|
sh ./createdb.sh $1 $1 $MYSQL_pass
|
||
|
echo "Database created"
|
||
|
echo "Name: $1"
|
||
|
echo "Database: $1"
|
||
|
echo "Pass: $MYSQL_pass"
|
||
|
|
||
|
mail="$1_mail.txt"
|
||
|
sed_name='s/${name}/'$1'/'
|
||
|
sed_pass='s/${pass}/'$pass'/'
|
||
|
sed_mysqlpass='s/${MYSQL_pass}/'$MYSQL_pass'/'
|
||
|
sed_server='s/${server}/'$server'/'
|
||
|
|
||
|
sed -e $sed_name \
|
||
|
-e $sed_pass \
|
||
|
-e $sed_mysqlpass \
|
||
|
-e $sed_server < mail.txt > $mail
|
||
|
|
||
|
#sh ./mail.sh $1 $pass $MYSQL_pass
|