2022-02-22 13:59:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2022-02-27 20:29:53 +01:00
|
|
|
#=================================================
|
2022-07-14 02:33:15 +02:00
|
|
|
# STANDARD RESTORATION STEPS
|
2022-02-27 20:29:53 +01:00
|
|
|
#=================================================
|
2022-07-14 02:33:15 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Restoring the app main directory..."
|
2022-02-27 20:29:53 +01:00
|
|
|
|
2023-08-13 12:38:51 +02:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2022-02-27 20:29:53 +01:00
|
|
|
|
2023-08-13 12:38:51 +02:00
|
|
|
chown -R root:root "$install_dir"
|
2022-02-22 13:59:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RESTORE THE DATA DIRECTORY
|
|
|
|
#=================================================
|
2022-05-07 18:24:57 +02:00
|
|
|
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
2022-02-22 13:59:54 +01:00
|
|
|
|
2023-08-13 12:38:51 +02:00
|
|
|
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
2022-02-22 13:59:54 +01:00
|
|
|
|
2023-08-13 12:38:51 +02:00
|
|
|
chown -R root:root "$data_dir"
|
2022-02-27 20:29:53 +01:00
|
|
|
|
2022-07-14 02:33:15 +02:00
|
|
|
#=================================================
|
2022-02-27 20:29:53 +01:00
|
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
2022-07-14 02:33:15 +02:00
|
|
|
#=================================================
|
2022-05-07 18:29:29 +02:00
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
2022-02-22 13:59:54 +01:00
|
|
|
|
2022-07-19 09:58:08 +02:00
|
|
|
# Don't add --needs_exposed_ports 445 , we don't want a remote diagnosis here
|
2023-08-13 12:49:12 +02:00
|
|
|
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports $port
|
2022-02-22 13:59:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-05-07 18:24:57 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=10
|
2022-02-22 13:59:54 +01:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=smbd --action="start"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-05-07 18:24:57 +02:00
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|