File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -25,40 +25,35 @@ randpass() {
2525 RET=` cat /dev/urandom | tr -cd " $CHAR " | head -c ${1:- 16} `
2626}
2727
28- INSTALL_DIR=" /var/www/$1 /htdocs"
29- mkdir -p $INSTALL_DIR
30- cd $INSTALL_DIR
31-
3228# Generate all required random passwords/salt/hashes
3329randpass
3430DB_PASS=$RET
3531randpass
3632USER_PASS=$RET
3733
34+ # Make user and group
35+ useradd $DOMAIN_NAME
36+ echo $USER_PASS > tmp
37+ echo $USER_PASS >> tmp
38+ passwd $DOMAIN_NAME < tmp
39+ rm tmp
40+
3841# Sanitize domain name to take out periods
3942DOMAIN_NAME=$( echo $1 | sed " s/\./__/" )
4043
44+ INSTALL_DIR=" /home/$DOMAIN_NAME /wordpress"
45+ mkdir -p $INSTALL_DIR
46+ cd $INSTALL_DIR
47+
4148# Get latest version, delete old version
4249rm latest.*
4350wget http://wordpress.org/latest.tar.gz
4451
4552# Extract to web directory
4653tar xf latest*
47- mv wordpress/* .
54+ mv wordpress/* /home/ $DOMAIN_NAME /wordpress/
4855rm -rf wordpress/
4956
50- # Make user and group
51- useradd $DOMAIN_NAME
52- groupadd $DOMAIN_NAME
53- echo $USER_PASS > tmp
54- echo $USER_PASS >> tmp
55- passwd $DOMAIN_NAME < tmp
56- usermod -g $DOMAIN_NAME $DOMAIN_NAME
57-
58- # chown and chgrp entire directory to new user
59- chown -R $DOMAIN_NAME *
60- chgrp -R $DOMAIN_NAME *
61-
6257# change permissions (not necessary so far)
6358
6459# Create Database and Database user
@@ -68,7 +63,6 @@ FLUSH PRIVILEGES;
6863EXIT;" > input
6964mysql --user=root --password=$2 < input > output.tab
7065
71-
7266# Make config.php file
7367echo " <?php
7468/**
You can’t perform that action at this time.
0 commit comments