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

61 lines
2.2 KiB
Text
Raw Permalink Normal View History

2016-03-18 18:38:54 +01:00
#!/bin/bash
2018-08-14 22:18:22 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
2022-01-14 23:57:33 +01:00
#=================================================
source _common.sh
2018-08-14 22:18:22 +02:00
source /usr/share/yunohost/helpers
2016-03-18 18:38:54 +01:00
2018-08-14 22:18:22 +02:00
#=================================================
# UPGRADE SETTINGS FROM OLD INSTALL
#=================================================
2022-01-15 12:05:29 +01:00
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
2018-08-14 22:18:22 +02:00
2022-05-28 14:59:15 +02:00
# Manage migrations
ynh_script_progression --message="Migrating database if needed..."
if ynh_compare_current_package_version --comparison le --version 4.0.0~ynh0; then
ynh_replace_string --match_string __APP__ --replace_string $app --target_file migrations/3.2-4.0.sh
ynh_replace_string --match_string __DBUSER__ --replace_string $db_user --target_file migrations/3.2-4.0.sh
ynh_replace_string --match_string __DBPASS__ --replace_string $db_pwd --target_file migrations/3.2-4.0.sh
bash migrations/3.2-4.0.sh
fi
2022-01-15 10:12:54 +01:00
#=================================================
# UPDATE A CONFIG FILE
#=================================================
2022-01-15 12:10:50 +01:00
ynh_script_progression --message="Configuring application..." --weight=1
2018-08-14 22:18:22 +02:00
# Configure SOGO
2024-01-30 23:33:35 +01:00
ynh_add_config --template="sogo.conf" --destination="/etc/$app/sogo.conf"
2022-01-15 10:05:56 +01:00
2018-08-14 22:18:22 +02:00
#=================================================
2024-01-30 23:33:35 +01:00
# REAPPLY SYSTEM CONFIGURATIONS
2018-08-14 22:18:22 +02:00
#=================================================
2024-01-30 23:33:35 +01:00
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
2018-08-14 22:18:22 +02:00
2024-01-30 23:33:35 +01:00
config_nginx
2018-08-14 22:18:22 +02:00
2024-01-31 10:33:23 +01:00
yunohost service add "sogo" --description="Groupware for E-Mail, Contacts and Calender" --log="/var/log/$app/$app.log"
2022-01-15 10:11:21 +01:00
# Use logrotate to manage app-specific logfile(s)
2022-06-18 12:05:22 +02:00
ynh_use_logrotate --logfile="/var/log/$app/sogo.log" --nonappend
2018-08-14 22:18:22 +02:00
2024-02-23 00:20:43 +01:00
set_permissions
2022-01-15 10:09:18 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
2024-01-30 23:33:35 +01:00
ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd"
2022-01-14 23:57:33 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last