mirror of
https://github.com/YunoHost-Apps/wallabag2_ynh.git
synced 2024-10-01 13:35:06 +02:00
Merge pull request #44 from YunoHost-Apps/fix_restore
Fix 20-app.ini in restore
This commit is contained in:
commit
b2968c62c9
2 changed files with 15 additions and 12 deletions
|
@ -22,7 +22,7 @@ source /usr/share/yunohost/helpers
|
|||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
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)
|
||||
|
||||
#=================================================
|
||||
|
@ -32,24 +32,24 @@ db_name=$(ynh_app_setting_get $app db_name)
|
|||
#=================================================
|
||||
|
||||
CHECK_SIZE "$final_path"
|
||||
ynh_backup "$final_path" "sources"
|
||||
ynh_backup "$final_path"
|
||||
|
||||
#=================================================
|
||||
# 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
|
||||
#=================================================
|
||||
|
||||
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
|
||||
#=================================================
|
||||
|
||||
ynh_mysql_dump_db "$db_name" > dump.sql
|
||||
CHECK_SIZE "dump.sql"
|
||||
ynh_backup "dump.sql" "db.sql"
|
||||
ynh_mysql_dump_db "$db_name" > db.sql
|
||||
CHECK_SIZE "db.sql"
|
||||
|
|
|
@ -31,8 +31,10 @@ db_name=$(ynh_app_setting_get $app db_name)
|
|||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
|
||||
CHECK_DOMAINPATH # Check domain and path availability
|
||||
CHECK_FINALPATH # Check if destination directory is not already in use
|
||||
ynh_webpath_available $domain $path_url \
|
||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die "There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
|
@ -46,13 +48,13 @@ ynh_install_app_dependencies "$PKG_DEPENDENCIES"
|
|||
# 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
|
||||
#=================================================
|
||||
|
||||
cp -a ./sources/. $final_path
|
||||
ynh_restore_file "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE MYSQL DB
|
||||
|
@ -78,7 +80,8 @@ chown -R $app: $final_path
|
|||
# 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
|
||||
|
|
Loading…
Add table
Reference in a new issue