diff --git a/check_process b/check_process index 359db85..4e51f1b 100644 --- a/check_process +++ b/check_process @@ -24,37 +24,12 @@ fail_download_source=0 port_already_use=0 final_path_already_use=0 -;; Test avec multisite - auto_remove=1 - ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - language="fr_FR" - multisite="Yes" - is_public="Yes" (PUBLIC|public=Yes|private=No) - ; Checks - setup_sub_dir=1 - setup_root=0 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - backup_restore=1 - multi_instance=1 - wrong_user=0 - wrong_path=0 - incorrect_path=0 - corrupt_source=0 - fail_download_source=0 - port_already_use=0 - final_path_already_use=0 ;;; Levels Level 1=auto Level 2=auto Level 3=auto - Level 4=1 - Level 5=1 + Level 4=0 + Level 5=auto Level 6=auto Level 7=auto Level 8=0 diff --git a/scripts/backup b/scripts/backup index 8f7e727..fe7ddd8 100644 --- a/scripts/backup +++ b/scripts/backup @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) -with_mysql=$(ynh_app_setting_get "$app" with_mysql) # Copy the app files final_path="/var/www/${app}" @@ -21,4 +20,4 @@ ynh_backup "$final_path" "sources" 1 ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" # Copy the php-fpm conf files ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf" -ynh_backup "/etc/php5/fpm/conf.d/20-${app}.ini" "php-fpm.ini" +ynh_backup "/etc/php5/fpm/conf.d/20-${app}.ini" "php-fpm.ini" \ No newline at end of file diff --git a/scripts/restore b/scripts/restore index 28844d0..876b44d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,22 +19,29 @@ is_public=$(ynh_app_setting_get $app is_public) sudo yunohost app checkurl "${domain}${path}" -a "$app" \ || ynh_die "Path not available: ${domain}${path}" -# Check configuration files php-fpm +# Check $final_path +final_path="/var/www/${app}" +if [ -d $final_path ]; then + ynh_die "There is already a directory: $final_path" +fi + +# Check configuration files nginx nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf" -[[ -f $nginx_conf ]] && ynh_die \ -"The NGINX configuration already exists at '${nginx_conf}'. - You should safely delete it before restoring this app." +if [ -f $nginx_conf ]; then + ynh_die "The NGINX configuration already exists at '${nginx_conf}'. You should safely delete it before restoring this app." + +# Check configuration files php-fpm phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf" -[[ -f $phpfpm_conf ]] && ynh_die \ -"The PHP FPM configuration already exists at '${phpfpm_conf}'. - You should safely delete it before restoring this app." +if [ -f $phpfpm_conf ]; then + ynh_die "The PHP FPM configuration already exists at '${phpfpm_conf}'. You should safely delete it before restoring this app." +fi + phpfpm_ini="/etc/php5/fpm/conf.d/20-${app}.ini" -[[ -f $phpfpm_ini ]] && ynh_die \ -"The PHP FPM INI configuration already exists at '${phpfpm_ini}'. - You should safely delete it before restoring this app." +if [ -f $phpfpm_ini ]; then + ynh_die "The PHP FPM INI configuration already exists at '${phpfpm_ini}'. You should safely delete it before restoring this app." +fi # Restore sources & data -final_path="/var/www/${app}" sudo cp -a ./sources "$final_path" # Set permissions diff --git a/scripts/upgrade b/scripts/upgrade index 943d6f9..b44d697 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,4 +40,4 @@ else fi # Reload Nginx -sudo service nginx reload \ No newline at end of file +sudo service nginx reload || true \ No newline at end of file