diff --git a/scripts/backup b/scripts/backup index 337578d..e026662 100755 --- a/scripts/backup +++ b/scripts/backup @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -55,22 +51,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# BACKUP OF THE DATABASE -#================================================= - -if [ $database -eq 1 ]; then - # Backup MySQL database - ynh_print_info --message="Backup of the MySQL database..." - ynh_mysql_dump_db --database="$db_name" > db.sql -elif [ $database -eq 2 ]; then - # Backup PostgreSQL database - ynh_print_info --message="Backup of the PostgreSQL database..." - ynh_psql_dump_db --database="$db_name" > db.sql -fi - -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= @@ -90,6 +70,20 @@ ynh_backup --src_path="/etc/cron.d/$app" ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" +#================================================= +# BACKUP OF THE DATABASE +#================================================= + +if [ $database -eq 1 ]; then + # Backup MySQL database + ynh_print_info --message="Backup of the MySQL database..." + ynh_mysql_dump_db --database="$db_name" > db.sql +elif [ $database -eq 2 ]; then + # Backup PostgreSQL database + ynh_print_info --message="Backup of the PostgreSQL database..." + ynh_psql_dump_db --database="$db_name" > db.sql +fi + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index dc3e0a8..6b64bb6 100755 --- a/scripts/install +++ b/scripts/install @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -50,11 +46,11 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= ynh_script_progression --message="Storing installation settings..." -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=email --value=$email -ynh_app_setting_set --app=$app --key=upload --value=$upload +ynh_app_setting_set --app=$app --key=domain --value=$domain +ynh_app_setting_set --app=$app --key=path --value=$path_url +ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=email --value=$email +ynh_app_setting_set --app=$app --key=upload --value=$upload ynh_app_setting_set --app=$app --key=database --value=$database ynh_app_setting_set --app=$app --key=random_string --value=$random_string @@ -122,7 +118,6 @@ pushd "$final_path" ln -s ../extend/addon/zaddons/$base $base done - popd diff --git a/scripts/upgrade b/scripts/upgrade index 9987b40..76d3da1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,7 +77,7 @@ ynh_setup_source --dest_dir="$final_path" # cp -a "$tmpdir/.htconfig.php" "${final_path}" # cp -a "$tmpdir/php.log" "${final_path}" # ynh_secure_remove "$tmpdir" -# chmod -R 777 $final_path/store +# chmod -R 775 $final_path/store # mkdir $final_path/addon # ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" @@ -115,7 +115,7 @@ if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then fi; done popd - chmod -R 777 $final_path/store + chmod -R 775 $final_path/store else # Create a temporary directory @@ -137,7 +137,7 @@ else cp -a "$tmpdir/.htconfig.php" "${final_path}" cp -a "$tmpdir/php.log" "${final_path}" ynh_secure_remove --file="$tmpdir" - chmod -R 777 $final_path/store + chmod -R 775 $final_path/store mkdir $final_path/addon ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" fi