1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00

Fix linter warnings

This commit is contained in:
ericgaspar 2020-12-06 21:39:09 +01:00
parent 3b3d949ab2
commit 613caaee69
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 47 additions and 23 deletions

View file

@ -14,36 +14,57 @@ source /usr/share/yunohost/helpers
# Stop script if errors
ynh_abort_if_errors
ynh_script_progression --message="Loading installation settings..."
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
# retrieve useful param
domain=$(ynh_app_setting_get --app $app --key domain)
db_name=$(ynh_app_setting_get --app $app --key db_name)
#=================================================
# STANDARD BACKUP STEPS
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Backing up configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP THE NGINX CONFIGURATION
ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP SOGO CONFIG
#=================================================
# Backup SOGo config
ynh_backup --src_path "/etc/$app"
ynh_backup --src_path="/etc/$app"
# Backup stunnel config
ynh_backup --src_path "/etc/stunnel/$app.conf"
#=================================================
# BACKUP STUNNEL CONFIG
#=================================================
ynh_backup --src_path="/etc/stunnel/$app.conf"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
# Backup Cron
ynh_backup --src_path "/etc/cron.d/$app"
ynh_backup --src_path="/etc/cron.d/$app"
# Backup Logs
ynh_script_progression --message="Backing up logs"
ynh_backup --src_path "/var/log/$app"
ynh_backup --src_path="/var/log/$app"
#=================================================
# BACKUP THE MYSQL DATABASE
ynh_script_progression --message="Backing up database"
#=================================================
ynh_print_info --message="Backing up database"
ynh_mysql_dump_db "$db_name" > db.sql
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -14,18 +14,21 @@ source /usr/share/yunohost/helpers
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
# LOAD SETTINGS
domain=$(ynh_app_setting_get --app $app --key domain)
path_url=$(ynh_normalize_url_path --path_url $(ynh_app_setting_get --app $app --key path))
admin=$(ynh_app_setting_get --app $app --key admin)
is_public=$(ynh_app_setting_get --app $app --key is_public)
port=$(ynh_app_setting_get --app $app --key web_port)
smtp_port=$(ynh_app_setting_get --app $app --key smtp_port)
db_name=$(ynh_app_setting_get --app $app --key db_name)
db_user=$(ynh_app_setting_get --app $app --key db_user)
db_pwd=$(ynh_app_setting_get --app $app --key mysqlpwd)
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
port=$(ynh_app_setting_get --app=$app --key=web_port)
smtp_port=$(ynh_app_setting_get --app=$app --key=smtp_port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$(ynh_app_setting_get --app=$app --key=db_user)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
# Backup the current version of the app
ynh_backup_before_upgrade