mirror of
https://github.com/YunoHost-Apps/hubzilla_ynh.git
synced 2024-09-03 19:26:21 +02:00
Fix
This commit is contained in:
parent
5dfddca7d1
commit
9ab4030a1e
2 changed files with 16 additions and 15 deletions
|
@ -56,20 +56,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
|
||||
#=================================================
|
||||
|
@ -91,6 +77,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
|
||||
#=================================================
|
||||
|
|
|
@ -31,6 +31,7 @@ email=$(ynh_user_get_info --username=$admin --key=mail)
|
|||
upload="256M"
|
||||
random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)"
|
||||
database=`expr $YNH_APP_ARG_DATABASE`
|
||||
phpversion=$YNH_PHP_VERSION
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -163,7 +164,7 @@ if [ $database -eq 1 ]; then
|
|||
elif [ $database -eq 2 ]; then
|
||||
# Create postgresql database
|
||||
ynh_script_progression --message="Creating a PostgreSQL database..."
|
||||
ynh_replace_string --match_string="db_type = 0;" --replace_string="db_type = 1;" --target_file="$config"
|
||||
ynh_replace_string --match_string="db_type = 0;" --replace_string="db_type = 1;" --target_file="$final_path/.htconfig.php"
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
ynh_psql_test_if_first_run
|
||||
|
|
Loading…
Add table
Reference in a new issue