-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetupWordpress
More file actions
executable file
·20 lines (19 loc) · 905 Bytes
/
Copy pathsetupWordpress
File metadata and controls
executable file
·20 lines (19 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
mkdir "$HOME/public_html/oldSite"
mv "$HOME/public_html/*" "$HOME/public_html/oldSite"
curl https://wordpress.org/latest.tar.gz -o "$HOME/latest.tar.gz"
touch "$HOME/public_html/.htaccess"
chmod 755 "$HOME/public_html/.htaccess"
tar -pxzvf "$HOME/latest.tar.gz" -C "$HOME/public_html/"
mv "$HOME/public_html/wordpress/*" "$HOME/public_html/"
rm -rf "$HOME/latest.tar.gz" "$HOME/public_html/wordpress"
mv "$HOME/public_html/wp-config-sample.php" "$HOME/public_html/wp-config.php"
#edit wp-config with details
user=$(whoami)
echo "enter your mysql password"
read -r PASS
sed -i "s/database_name_here/$user/g" "$HOME/public_html/wp-config.php"
sed -i "s/username_here/$user/g" "$HOME/public_html/wp-config.php"
sed -i "s/password_here/$PASS/g" "$HOME/public_html/wp-config.php"
sed -i "s/localhost/mysql.internal/g" "$HOME/public_html/wp-config.php"
chmod 400 "$HOME/public_html/wp-config.php"