2022-02-22 13:59:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
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
|
|
|
|
#=================================================
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_script_progression "Restoring the app main directory..."
|
2022-02-27 20:29:53 +01:00
|
|
|
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_restore "$install_dir"
|
2022-02-22 13:59:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RESTORE THE DATA DIRECTORY
|
|
|
|
#=================================================
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_script_progression "Restoring the data directory..."
|
2022-02-22 13:59:54 +01:00
|
|
|
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_restore "$data_dir"
|
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
|
|
|
#=================================================
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_script_progression "Integrating service in YunoHost..."
|
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
|
|
|
|
#=================================================
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2022-02-22 13:59:54 +01:00
|
|
|
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_systemctl --service=smbd --action="start"
|
2022-02-22 13:59:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-31 02:58:19 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|