1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wireguard_ynh.git synced 2024-09-03 20:35:58 +02:00

Start and enable the VPN service

This commit is contained in:
tituspijean 2021-12-21 17:57:39 +01:00
parent 29f4015f46
commit 33d7348d7e
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
3 changed files with 29 additions and 7 deletions

View file

@ -178,13 +178,21 @@ yunohost service add wg-quick@wg0 --description="WireGuard VPN" --needs_exposed_
yunohost service add wireguard_ui --description="WireGuard UI" yunohost service add wireguard_ui --description="WireGuard UI"
#================================================= #=================================================
# START SYSTEMD SERVICE # START UI SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting the systemd service for the UI..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=wireguard_ui --action="start" --line_match="http server started" --log_path="systemd" --timeout=30 ynh_systemd_action --service_name=wireguard_ui --action="start" --line_match="http server started" --log_path="systemd" --timeout=30
#=================================================
# START VPN SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting the systemd service for the VPN..." --weight=1
# Start and enable a systemd service
systemctl enable --now wg-quick@wg0
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================

View file

@ -135,12 +135,19 @@ yunohost service add wireguard_ui --description="WireGuard UI"
ynh_restore_file --origin_path=$(jq -r ".config_file_path" $final_path/db/server/global_settings.json) --not_mandatory ynh_restore_file --origin_path=$(jq -r ".config_file_path" $final_path/db/server/global_settings.json) --not_mandatory
#================================================= #=================================================
# START SYSTEMD SERVICE # START UI SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting the systemd service for the UI..." --weight=1
ynh_systemd_action --service_name=wireguard_ui --action="start" --line_match="http server started" --log_path="systemd" --timeout=30 ynh_systemd_action --service_name=wireguard_ui --action="start" --line_match="http server started" --log_path="systemd" --timeout=30
sleep 5
#=================================================
# START VPN SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting the systemd service for the VPN..." --weight=1
# Start and enable a systemd service
systemctl enable --now wg-quick@wg0
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -219,11 +219,18 @@ yunohost service add wireguard_ui --description="WireGuard UI"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting the systemd service for the UI..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=wireguard_ui --action="start" --line_match="http server started" --log_path="systemd" --timeout=30 ynh_systemd_action --service_name=wireguard_ui --action="start" --line_match="http server started" --log_path="systemd" --timeout=30
sleep 5
#=================================================
# START VPN SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting the systemd service for the VPN..." --weight=1
# Start and enable a systemd service
systemctl enable --now wg-quick@wg0
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX