1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grav_ynh.git synced 2024-09-03 19:16:01 +02:00

Mise à jour du fichier check_process

This commit is contained in:
magikcypress 2017-03-10 16:59:58 +01:00
parent f8262913cc
commit 6c72f7c122
4 changed files with 22 additions and 41 deletions

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -40,4 +40,4 @@ else
fi
# Reload Nginx
sudo service nginx reload
sudo service nginx reload || true