1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

Update upgrade

This commit is contained in:
abeudin 2014-06-16 15:10:13 +02:00
parent c6cf0a1eaa
commit 1951f816c6

View file

@ -42,40 +42,6 @@ if [[ "$admin_wordpress" = "" || "$is_public" = "" || "$language" = "" ]]; then
exit 1 exit 1
fi fi
# Generate random password
db_pwd=$(sudo yunohost app setting wordpress mysqlpwd)
# Use 'wordpress' as database name and user
db_user=wordpress
### Execute potential SQL statements here
# Copy files to the right place
final_path=/var/www/wordpress
sudo mkdir -p $final_path
sudo cp -a ../sources/* $final_path
sudo cp ../conf/wp-config.php $final_path/wp-config.php
# Change variables in Wordpress configuration
sudo sed -i "s/yunouser/$db_user/g" $final_path/wp-config.php
sudo sed -i "s/yunopass/$db_pwd/g" $final_path/wp-config.php
sudo sed -i "s/yunobase/$db_user/g" $final_path/wp-config.php
for i in 1 2 3 4 5 6 7 8
do
j=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{40\}\).*/\1/p')
if [ "$j" = "" ];
then
# For obscure reasons, the loop is too fast at execution
sleep 1
j=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{40\}\).*/\1/p')
fi
sudo sed -i "s/KEY$i/$j/g" $final_path/wp-config.php
done
sudo sed -i "s/I18NTOCHANGE/$language/g" $final_path/wp-config.php
sudo sed -i "s@URLWORDPRESS@$domain$path@g" ../conf/*.sql
# Set permissions to roundcube directory
sudo chown -R www-data: $final_path
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf* sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*