Skip to content

Commit 3d40726

Browse files
author
enoch85
committed
allow root (workaround)
1 parent ae6b659 commit 3d40726

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

install-redis-php-7.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ rm -rf $SCRIPTS/redis
8181
rm $SCRIPTS/redis-stable.tar.gz
8282

8383
cd $WPATH
84-
sudo -u wordpress -i -- wp plugin install redis-cache --activate
84+
wp plugin install redis-cache --activate --allow-root
8585

8686
# Cleanup
8787
apt-get purge -y \
@@ -120,4 +120,7 @@ apt-get purge -y \
120120
make \
121121
manpages-dev
122122

123+
apt-get autoremove -y
124+
apt-get autoclean
125+
123126
exit 0

wordpress_install.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ 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-
sudo -u wordpress -i -- wp --info
140+
wp --info
141141

142142
# Create dir
143143
mkdir $WPATH
@@ -157,7 +157,7 @@ mkdir $WPATH
157157
#mkdir $WPATH/wp-content/uploads
158158

159159
cd $WPATH
160-
sudo -u wordpress -i -- wp core download --force --debug --path=$WPATH
160+
wp core download --allow-root --force --debug --path=$WPATH
161161

162162
# Populate DB
163163
mysql -uroot -p$MYSQL_PASS <<MYSQL_SCRIPT
@@ -166,29 +166,29 @@ CREATE USER '$WPDBUSER'@'localhost' IDENTIFIED BY '$WPDBPASS';
166166
GRANT ALL PRIVILEGES ON $WPDBNAME.* TO '$WPDBUSER'@'localhost';
167167
FLUSH PRIVILEGES;
168168
MYSQL_SCRIPT
169-
sudo -u wordpress -i -- wp core config --dbname=$WPDBNAME --dbuser=$WPDBUSER --dbpass=$WPDBPASS --dbhost=localhost
169+
wp core config --allow-root --dbname=$WPDBNAME --dbuser=$WPDBUSER --dbpass=$WPDBPASS --dbhost=localhost
170170
echo "Wordpress DB: $WPDBPASS" >> $PW_FILE
171171

172172
# Install Wordpress
173-
sudo -u wordpress -i -- wp core install --url=http://$ADDRESS/wordpress/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password=$WPDMINPASS [email protected]
173+
wp core install --allow-root --url=http://$ADDRESS/wordpress/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password=$WPDMINPASS [email protected]
174174
echo "Wordpress admin login: $WPADMINPASS" > /var/adminpass.txt
175175
chown wordpress:wordpress /var/adminpass.txt
176176

177-
sudo -u wordpress -i -- wp core version
177+
wp core version --allow-root
178178
sleep 3
179179

180180
# Install Apps
181-
sudo -u wordpress -i -- wp plugin install twitter-tweets --activate
182-
sudo -u wordpress -i -- wp plugin install social-pug --activate
183-
sudo -u wordpress -i -- wp plugin install wp-mail-smtp --activate
181+
wp plugin install --allow-root twitter-tweets --activate
182+
wp plugin install --allow-root social-pug --activate
183+
wp plugin install --allow-root wp-mail-smtp --activate
184184

185185
# set pretty urls
186-
sudo -u wordpress -i -- wp rewrite structure '/%postname%/' --hard
187-
sudo -u wordpress -i -- wp rewrite flush --hard
186+
wp rewrite structure '/%postname%/' --hard --allow-root
187+
wp rewrite flush --hard --allow-root
188188

189189
# delete akismet and hello dolly
190-
sudo -u wordpress -i -- wp plugin delete akismet
191-
sudo -u wordpress -i -- wp plugin delete hello
190+
wp plugin delete akismet --allow-root
191+
wp plugin delete hello --allow-root
192192

193193
# Secure permissions
194194
wget -q $GITHUB_REPO/wp-permissions.sh -P $SCRIPTS
@@ -379,7 +379,7 @@ else
379379
sleep 2
380380
fi
381381

382-
# Make $SCRIPTS excutable
382+
# Make $SCRIPTS excutable
383383
chmod +x -R $SCRIPTS
384384
chown root:root -R $SCRIPTS
385385

wordpress_update.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ WPATH=/var/www/html/wordpress
1414
sudo apt-get update
1515
sudo aptitude full-upgrade -y
1616
cd $WPATH
17-
sudo -u wordpress -i -- wp db export mysql_backup.sql
18-
sudo -u wordpress -i -- wp core update --force
19-
sudo -u wordpress -i -- wp plugin update
20-
sudo -u wordpress -i -- wp core update-db
21-
sudo -u wordpress -i -- wp db optimize
17+
wp db export mysql_backup.sql --allow-root
18+
wp core update --force --allow-root
19+
wp plugin update --allow-root
20+
wp core update-db --allow-root
21+
wp db optimize --allow-root
2222
echo
2323
echo "This is the current version installed:
2424
echo
25-
sudo -u wordpress -i -- wp wp core version --extra
25+
wp wp core version --extra --allow-root
2626
sleep 5
2727
2828
# Set secure permissions

0 commit comments

Comments
 (0)