diff --git a/scripts/install b/scripts/install index 94224e1..b6e6598 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/restore b/scripts/restore index fda58a3..a9beda4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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