Skip to content

Commit cd0a803

Browse files
author
enoch85
committed
minor fixes
1 parent 3d40726 commit cd0a803

File tree

3 files changed

+15
-26
lines changed

3 files changed

+15
-26
lines changed

techandme.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
#!/bin/bash
22
WANIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
33
ADDRESS=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
4-
WPADMINPASS=$(grep -Fxq "Wordpress admin login" /var/adminpass.txt)
4+
WPADMINPASS=$(grep "WP PASS:" /var/adminpass.txt)
55
clear
66
figlet -f small Tech and Me
77
echo " https://www.techandme.se"
88
echo
99
echo
10-
echo "|NETWORK|"
10+
echo "--|NETWORK|--"
1111
echo "WAN IP: $WANIP"
1212
echo "LAN IP: $ADDRESS"
1313
echo
14-
echo "|LOGIN|"
14+
echo "--|WORDPRESS LOGIN|--"
1515
echo "WP USER: change_wordpress_user#"
16-
echo "WP PASS: $WPADMINPASS"
17-
echo "MySQL: /var/mysql_password.txt"
18-
16+
echo "$WPADMINPASS"
17+
echo
18+
echo "--|MySQL|--"
19+
echo "PASS: /var/mysql_password.txt"
20+
echo
1921
exit 0

wordpress_install.sh

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,12 @@ apt-get install -y \
137137
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
138138
chmod +x wp-cli.phar
139139
mv wp-cli.phar /usr/local/bin/wp
140-
wp --info
140+
wp --info --allow-root
141141

142142
# Create dir
143143
mkdir $WPATH
144144

145-
# Download Wordpress (PLAN B)
146-
#echo "Downloading..."
147-
#curl -O https://wordpress.org/latest.tar.gz
148-
#echo "Unpacking..."
149-
#tar -zxf latest.tar.gz
150-
#mv wordpress/* $WPATH
151-
#echo "Cleaning up..."
152-
#rm -R wordpress/
153-
#rm latest.tar.gz
154-
155-
# Create missing files and folders
156-
#mv $WPATH/wp-config-sample.php $WPATH/wp-config.php
157-
#mkdir $WPATH/wp-content/uploads
158-
145+
# Download Wordpress
159146
cd $WPATH
160147
wp core download --allow-root --force --debug --path=$WPATH
161148

@@ -170,8 +157,8 @@ wp core config --allow-root --dbname=$WPDBNAME --dbuser=$WPDBUSER --dbpass=$WPDB
170157
echo "Wordpress DB: $WPDBPASS" >> $PW_FILE
171158

172159
# Install Wordpress
173-
wp core install --allow-root --url=http://$ADDRESS/wordpress/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password=$WPDMINPASS [email protected]
174-
echo "Wordpress admin login: $WPADMINPASS" > /var/adminpass.txt
160+
wp core install --allow-root --url=http://$ADDRESS/wordpress/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password=$WPADMINPASS [email protected]
161+
echo "WP PASS: $WPADMINPASS" > /var/adminpass.txt
175162
chown wordpress:wordpress /var/adminpass.txt
176163

177164
wp core version --allow-root
@@ -195,7 +182,7 @@ wget -q $GITHUB_REPO/wp-permissions.sh -P $SCRIPTS
195182
bash $SCRIPTS/wp-permissions.sh
196183

197184
# Hardening security
198-
#create .htaccess to protect uploads directory
185+
# create .htaccess to protect uploads directory
199186
cat > $WPATH/wp-content/uploads/.htaccess <<'EOL'
200187
# Protect this file
201188
<Files .htaccess>

wordpress_update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ sudo aptitude full-upgrade -y
1616
cd $WPATH
1717
wp db export mysql_backup.sql --allow-root
1818
wp core update --force --allow-root
19-
wp plugin update --allow-root
19+
wp plugin update --all --allow-root
2020
wp core update-db --allow-root
2121
wp db optimize --allow-root
2222
echo
23-
echo "This is the current version installed:
23+
echo "This is the current version installed:"
2424
echo
2525
wp wp core version --extra --allow-root
2626
sleep 5

0 commit comments

Comments
 (0)