mirror of
https://github.com/YunoHost-Apps/syncthing_ynh.git
synced 2024-09-03 20:26:23 +02:00
commit
b0b21e66af
4 changed files with 15 additions and 6 deletions
|
@ -59,7 +59,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE DATA DIRECTORY
|
# BACKUP THE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up data directory..."
|
ynh_print_info --message="Backing up data directory..."
|
||||||
|
|
||||||
ynh_backup --src_path="$sync_home" --is_big
|
ynh_backup --src_path="$sync_home" --is_big
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ chown -R $app: $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add $app --description "$app daemon for Syncthing" --log_type "systemd"
|
yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
|
|
@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
sync_home=$(ynh_app_setting_get --app=$app --key=sync_home)
|
sync_home=$(ynh_app_setting_get --app=$app --key=sync_home)
|
||||||
|
sync_port=$(ynh_app_setting_get --app=$app --key=sync_port)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -44,6 +45,14 @@ test ! -d $final_path \
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
|
#=================================================
|
||||||
|
# OPEN A PORT
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring firewall..."
|
||||||
|
|
||||||
|
# Open the port
|
||||||
|
ynh_exec_warn_less yunohost firewall allow TCP $sync_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -91,14 +100,14 @@ chown -R "$app": "$sync_home"
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service
|
systemctl enable $app.service --quiet
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add $app --description "$app daemon for Syncthing" --log_type "systemd"
|
yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
|
|
@ -71,7 +71,7 @@ if [ -z $gui_port ]; then
|
||||||
|
|
||||||
systemctl stop syncthing@$OLD_SYNCUSER.service
|
systemctl stop syncthing@$OLD_SYNCUSER.service
|
||||||
yunohost service remove syncthing@$OLD_SYNCUSER.service
|
yunohost service remove syncthing@$OLD_SYNCUSER.service
|
||||||
systemctl disable syncthing@$OLD_SYNCUSER.service
|
systemctl disable syncthing@$OLD_SYNCUSER.service --quiet
|
||||||
|
|
||||||
ynh_secure_remove --file="/etc/apt/sources.list.d/syncthing.list"
|
ynh_secure_remove --file="/etc/apt/sources.list.d/syncthing.list"
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ ynh_add_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add $app --description "$app daemon for Syncthing" --log_type "systemd"
|
yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue