1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00

Fix 20-app.ini in restore

This commit is contained in:
Maniack Crudelis 2017-12-12 00:13:27 +01:00
parent 85a0f4bf7e
commit 094e802a74
2 changed files with 15 additions and 12 deletions

View file

@ -22,7 +22,7 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
final_path="/var/www/${app}" final_path=$(ynh_app_setting_get $app final_path)
db_name=$(ynh_app_setting_get $app db_name) db_name=$(ynh_app_setting_get $app db_name)
#================================================= #=================================================
@ -32,24 +32,24 @@ db_name=$(ynh_app_setting_get $app db_name)
#================================================= #=================================================
CHECK_SIZE "$final_path" CHECK_SIZE "$final_path"
ynh_backup "$final_path" "sources" ynh_backup "$final_path"
#================================================= #=================================================
# BACKUP NGINX CONFIGURATION # BACKUP NGINX CONFIGURATION
#================================================= #=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "nginx.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP PHP-FPM CONFIGURATION # BACKUP PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_backup "/etc/php5/fpm/pool.d/$app.conf" "php-fpm.conf" ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
#================================================= #=================================================
# BACKUP MYSQL DB # BACKUP MYSQL DB
#================================================= #=================================================
ynh_mysql_dump_db "$db_name" > dump.sql ynh_mysql_dump_db "$db_name" > db.sql
CHECK_SIZE "dump.sql" CHECK_SIZE "db.sql"
ynh_backup "dump.sql" "db.sql"

View file

@ -31,8 +31,10 @@ db_name=$(ynh_app_setting_get $app db_name)
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
CHECK_DOMAINPATH # Check domain and path availability yunohost app checkurl "${domain}${path_url}" -a "$app" \
CHECK_FINALPATH # Check if destination directory is not already in use || ynh_die "Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die "There is already a directory: $final_path "
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
@ -46,13 +48,13 @@ ynh_install_app_dependencies "$PKG_DEPENDENCIES"
# RESTORE NGINX CONFIGURATION # RESTORE NGINX CONFIGURATION
#================================================= #=================================================
cp -a ./nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE APP MAIN DIR # RESTORE APP MAIN DIR
#================================================= #=================================================
cp -a ./sources/. $final_path ynh_restore_file "$final_path"
#================================================= #=================================================
# RESTORE MYSQL DB # RESTORE MYSQL DB
@ -78,7 +80,8 @@ chown -R $app: $final_path
# RESTORE PHP-FPM CONFIGURATION # RESTORE PHP-FPM CONFIGURATION
#================================================= #=================================================
cp -a ./php-fpm.conf /etc/php5/fpm/pool.d/$app.conf ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION