mirror of
https://github.com/YunoHost-Apps/wordpress_ynh.git
synced 2024-09-03 20:36:10 +02:00
Fix restore and fix #6
This commit is contained in:
parent
a9d9b4ddb0
commit
738f00f45c
2 changed files with 7 additions and 19 deletions
|
@ -104,19 +104,14 @@ sudo yunohost app ssowatconf
|
|||
echo "127.0.0.1 $domain #wordpress_yunohost" | sudo tee -a /etc/hosts
|
||||
curl -kL --data "&weblog_title=YunoBlog&user_name=$admin_wordpress&admin_password=$db_pwd&admin_password2=$db_pwd&admin_email=$admin_wordpress@$domain&language=$language&Submit=Install+WordPress" https://$domain$path/wp-admin/install.php?step=2 > /dev/null 2>&1
|
||||
|
||||
sleep 5
|
||||
trap '' ERR # Ignoring exit signals
|
||||
mysql --debug-check -u $db_user -p$db_pwd $db_user -e "select * from wp_options;" > /dev/null 2>&1
|
||||
result=$?
|
||||
loop_number=1
|
||||
while [ $result != 0 ] && [ $loop_number -lt 5 ];
|
||||
do
|
||||
sleep 5
|
||||
mysql --debug-check -u $db_user -p$db_pwd $db_user -e "select * from wp_options;" > /dev/null 2>&1
|
||||
let result=$?
|
||||
let loop_number++
|
||||
for i in `seq 1 30`
|
||||
do # La boucle attend la fin de l'installation de wordpress Ou 30 secondes.
|
||||
if mysql --debug-check -u $db_user -p$db_pwd $db_user -e "show tables" | grep -q "wp_options"; then
|
||||
break # Si la table wp_options est trouvée, l'installation de wordpress est terminée. Quitte la boucle.
|
||||
fi
|
||||
echo -n "." >&2
|
||||
sleep 1
|
||||
done
|
||||
TRAP_ON
|
||||
|
||||
# Replace variables in sql scripts
|
||||
sudo sed -i "s@__DOMAIN_PATH__@$domain$path@g" ../conf/sql/*.sql
|
||||
|
|
|
@ -16,13 +16,6 @@ path=$(sudo yunohost app setting $app path)
|
|||
is_public=$(sudo yunohost app setting $app is_public)
|
||||
final_path=$(sudo yunohost app setting $app final_path)
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain$path -a $app
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
echo "There is already an app on this URL : $domain$path" | sudo tee /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d $final_path ]; then
|
||||
echo "There is already a directory: $final_path " | sudo tee /dev/stderr
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Reference in a new issue