-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwp-install.sh
47 lines (36 loc) · 1.36 KB
/
wp-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
readonly OOISVER="1.0.2"
readonly OOIS="oOWeb-WP-Setup-Script $OOISVER"
### SET WP PARAMS ###
WPURL=https://subdomain.domain.com # required
WPDOCROOT=/subdomain.domain.com/htdocs/ # required
WPDB=dbXXX # required
WPDBPW=pwXXX # required
WPTITLE='Website title goes here' # required
WPSUBTITLE='Website subtitle goes here' # required
### Have entered all required parameters correctly?
CONFIRM='no' # Change to "yes" after filling out lines
### SET WP PARAMS ###
### SET SOME DIRECTORIES ###
RUNDIR=$(pwd)
ACCOUNTNR=${USER##*\-} # # ACCOUNTNR=${LOGNAME:4}
ACCOUNTDIR=/www/htdocs/$ACCOUNTNR
### /SET SOME DIRECTORIES ###
clear
if [ "$CONFIRM" == "yes" ]; then
cd $ACCOUNTDIR$WPDOCROOT
WPPW=$(openssl rand -base64 64 | base64 | head -c 14)
wp core download --locale=de_DE
wp config create --dbname=$WPDB --dbuser=$WPDB --dbpass=$WPDBPW --dbhost=localhost
wp db create
wp core install --url="$WPURL" --title="$WPTITLE" --admin_user="onoffice-web" --admin_password="$WPPW" --admin_email="wp-admin@onofficeweb.com"
wp option set blog_public 0
wp option set blogdescription "$WPSUBTITLE"
wp plugin delete hello akismet
wp theme delete twentyseventeen twentynineteen twentytwenty
cd $RUNDIR
printf "\n\n\n +++ Temporary (please change) +++\n\n\n$WPPW\n\n\n"
exit
else
printf "\n\n\n+++ Please edit all configuration data in script wp-install.sh (lines 6-14) +++\n\n\n"
fi