2018-06-14 02:13:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2019-06-10 18:49:15 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2018-06-14 02:13:59 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-08-31 01:11:12 +02:00
|
|
|
#=================================================
|
2024-08-12 13:03:41 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2018-06-14 02:13:59 +02:00
|
|
|
#=================================================
|
2024-08-12 13:03:41 +02:00
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
2021-01-11 00:36:16 +01:00
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2018-06-14 02:13:59 +02:00
|
|
|
|
|
|
|
#=================================================
|
2024-08-12 13:03:41 +02:00
|
|
|
# RESTORE THE DATA DIRECTORY
|
2018-06-14 02:13:59 +02:00
|
|
|
#=================================================
|
2024-08-12 13:03:41 +02:00
|
|
|
ynh_script_progression --message="Restoring the user and SSH configuration..." --weight=1
|
2021-01-11 00:36:16 +01:00
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
ynh_system_user_create --username="$ssh_user" --home_dir="/home/$ssh_user" --use_shell --groups ssh.app
|
2018-06-14 02:13:59 +02:00
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
ynh_restore_file --origin_path="/home/$ssh_user/.ssh"
|
|
|
|
ynh_restore_file --origin_path="/home/$ssh_user/.nobackup"
|
2023-12-04 20:31:10 +01:00
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
#=================================================
|
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
2023-12-04 20:31:10 +01:00
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
2018-06-14 02:13:59 +02:00
|
|
|
|
2021-01-11 00:36:16 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|