mirror of
https://github.com/YunoHost-Apps/mailman3_ynh.git
synced 2024-09-03 19:36:17 +02:00
131 lines
4.2 KiB
Text
131 lines
4.2 KiB
Text
|
#!/bin/bash
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
|
||
|
#=================================================
|
||
|
# GENERIC START
|
||
|
#=================================================
|
||
|
# IMPORT GENERIC HELPERS
|
||
|
#=================================================
|
||
|
|
||
|
source ../settings/scripts/_common.sh
|
||
|
source /usr/share/yunohost/helpers
|
||
|
source ../settings/scripts/ynh_add_extra_apt_repos__3
|
||
|
|
||
|
#=================================================
|
||
|
# MANAGE SCRIPT FAILURE
|
||
|
#=================================================
|
||
|
|
||
|
ynh_clean_setup () {
|
||
|
ynh_clean_check_starting
|
||
|
}
|
||
|
|
||
|
ynh_abort_if_errors
|
||
|
|
||
|
#=================================================
|
||
|
# LOAD SETTINGS
|
||
|
#=================================================
|
||
|
|
||
|
ynh_script_progression --message="Loading settings..." --weight=2
|
||
|
|
||
|
app=$YNH_APP_INSTANCE_NAME
|
||
|
|
||
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||
|
|
||
|
#=================================================
|
||
|
# CHECK IF THE APP CAN BE RESTORED
|
||
|
#=================================================
|
||
|
|
||
|
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
||
|
|
||
|
ynh_webpath_available --domain=$domain \
|
||
|
|| ynh_die --message="Path not available: ${domain}"
|
||
|
|
||
|
test ! -d /usr/share/mailman3-web \
|
||
|
|| ynh_die --message="There is already an installation present at /usr/share/mailman3-web?"
|
||
|
|
||
|
#=================================================
|
||
|
# STANDARD RESTORATION STEPS
|
||
|
#=================================================
|
||
|
|
||
|
#=================================================
|
||
|
# RESTORE THE NGINX CONFIGURATION
|
||
|
#=================================================
|
||
|
|
||
|
ynh_script_progression --message="Restoring nginx configuration..." --weight=1
|
||
|
|
||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||
|
|
||
|
#=================================================
|
||
|
# RESTORE THE APP MAIN DIRS
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Restoring the app main directory..." --weight=30
|
||
|
|
||
|
#=================================================
|
||
|
# SPECIFIC RESTORATION
|
||
|
#=================================================
|
||
|
|
||
|
#=================================================
|
||
|
# REINSTALL DEPENDENCIES
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Reinstalling dependencies..." --weight=30
|
||
|
|
||
|
#=================================================
|
||
|
# RESTORE THE POSTGRESQL DATABASES
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=14
|
||
|
# ynh_psql_test_if_first_run
|
||
|
# ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||
|
# ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
|
||
|
|
||
|
#=================================================
|
||
|
# RESTORE SYSTEMD CONFIGURATION
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Restoring the systemd configuration..." --weight=3
|
||
|
|
||
|
#=================================================
|
||
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Advertising service in admin panel..." --weight=3
|
||
|
|
||
|
#=================================================
|
||
|
# START SYSTEMD SERVICE
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Starting a systemd service..." --weight=41
|
||
|
|
||
|
#=================================================
|
||
|
# RESTORE THE CRON FILE
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Restoring a cron job for removing cache..." --weight=2
|
||
|
# ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||
|
|
||
|
#=================================================
|
||
|
# GENERIC FINALIZATION
|
||
|
#=================================================
|
||
|
# RELOAD NGINX
|
||
|
#=================================================
|
||
|
|
||
|
# TODO(decentral1se)
|
||
|
# ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
||
|
# ynh_systemd_action --service_name=nginx --action=reload
|
||
|
|
||
|
#=================================================
|
||
|
# END OF SCRIPT
|
||
|
#=================================================
|
||
|
|
||
|
ynh_script_progression --message="Restoration completed for $app" --last
|