diff --git a/scripts/backup b/scripts/backup index e990219..28d0cf3 100755 --- a/scripts/backup +++ b/scripts/backup @@ -58,7 +58,7 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" if [ $database == "mysql" ]; then ynh_print_info --message="Backup of the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql -else +elif [ $database == "postgresql" ]; then ynh_print_info --message="Backup of the PostgreSQL database..." ynh_psql_dump_db --database="$db_name" > db.sql fi diff --git a/scripts/install b/scripts/install index 324c433..c6f777c 100755 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,6 @@ ynh_app_setting_set --app=$app --key=random_string --value=$random_string # 1 - Zap ynh_script_progression --message="Setting up Zap source files..." -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src git clone https://codeberg.org/zot-archive/zap.git "$install_dir" --quiet @@ -112,7 +111,7 @@ if [ $database == "mysql" ]; then ynh_script_progression --message="Creating a MySQL database..." ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $install_dir/install/schema_mysql.sql -else +elif [ $database == "postgresql" ]; 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" diff --git a/scripts/remove b/scripts/remove index cc7877b..0a5a621 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers # Remove a database if it exists, along with the associated user if [ $database == "mysql" ]; then ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -else +elif [ $database == "postgresql" ]; then ynh_psql_remove_db --db_user=$db_user --db_name=$db_name fi diff --git a/scripts/restore b/scripts/restore index 0679a6e..b2fa666 100755 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) if [ $database == "mysql" ]; then ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql -else +elif [ $database == "postgresql" ]; then ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql fi