diff --git a/scripts/install b/scripts/install index ebe9f9c..0695e7a 100644 --- a/scripts/install +++ b/scripts/install @@ -176,6 +176,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +yunohost service add wireguard --description "WireGuard" --needs_exposed_ports $port_wg yunohost service add wireguard_ui --description "WireGuard UI" --log "/var/log/$app/ui.log" ### Additional options starting with 3.8: diff --git a/scripts/restore b/scripts/restore index 4668d35..21159ea 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) +port_wg=$(ynh_app_setting_get --app=$app --key=port_wg) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -97,7 +98,8 @@ systemctl enable $app.service #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -yunohost service add $app --description "WireGuard UI" --log "/var/log/$app/$app.log" +yunohost service add wireguard --description "WireGuard" --needs_exposed_ports $port_wg +yunohost service add wireguard_ui --description "WireGuard UI" --log "/var/log/$app/ui.log" #================================================= # RESTORE VARIOUS FILES @@ -110,7 +112,7 @@ ynh_restore_file --origin_path=$(jq -r ".config_file_path" $final_path/db/server #================================================= ynh_script_progression --message="Starting a systemd service..." --time --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=wireguard_ui --action="start" --log_path="/var/log/$app/ui.log" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 55f435c..c1b8263 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) +port_wg=$(ynh_app_setting_get --app=$app --key=port_wg) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -156,8 +157,8 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -yunohost service add wireguard_ui --description "WireGuard UI" --log "/var/log/$app/$app.log" yunohost service add wireguard --description "WireGuard" --needs_exposed_ports "$port_wg" +yunohost service add wireguard_ui --description "WireGuard UI" --log "/var/log/$app/ui.log" #================================================= # START SYSTEMD SERVICE @@ -165,7 +166,7 @@ yunohost service add wireguard --description "WireGuard" --needs_exposed_ports " ynh_script_progression --message="Starting a systemd service..." --time --weight=1 # Start a systemd service -ynh_systemd_action --service_name=wireguard_ui --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=wireguard_ui --action="start" --log_path="/var/log/$app/ui.log" #================================================= # RELOAD NGINX