Browse Source

Do not integrate ynh-vpnclient-checker anymore

Alexandre Aubin 4 years ago
parent
commit
08a76f402d
4 changed files with 15 additions and 12 deletions
  1. 2 3
      scripts/install
  2. 8 6
      scripts/remove
  3. 0 1
      scripts/restore
  4. 5 2
      scripts/upgrade

+ 2 - 3
scripts/install

@@ -99,9 +99,8 @@ yunohost service enable $service_name
 
 # checker service
 
-yunohost service add $service_checker_name --description "Makes sure that the VPN service is running" --need_lock
-yunohost service start $service_checker_name
-yunohost service enable $service_checker_name
+systemctl start $service_checker_name
+systemctl enable $service_checker_name
 systemctl start $service_checker_name.timer
 systemctl enable $service_checker_name.timer
 

+ 8 - 6
scripts/remove

@@ -39,15 +39,17 @@ domain=$(ynh_app_setting_get $app domain)
 #=================================================
 ynh_print_info "Stopping and removing services"
 
-yunohost service stop $service_checker_name
-yunohost service disable $service_checker_name
-yunohost service remove $service_checker_name
+systemctl stop $service_checker_name
+systemctl disable $service_checker_name
 systemctl stop $service_checker_name.timer && sleep 1
 systemctl disable $service_checker_name.timer
 
-yunohost service stop $service_name
-yunohost service disable $service_name
-yunohost service remove $service_name
+if ynh_exec_warn_less yunohost service status $service_name >/dev/null
+then
+    yunohost service stop $service_name
+    yunohost service disable $service_name
+    yunohost service remove $service_checker
+fi
 
 for FILE in $(ls /etc/systemd/system/$service_name* /usr/local/bin/ynh-vpnclient* /tmp/.ynh-vpnclient-*)
 do

+ 0 - 1
scripts/restore

@@ -117,7 +117,6 @@ systemctl enable "openvpn@.service"
 #=================================================
 
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock
-yunohost service add $service_checker_name --description "Makes sure that the VPN service is running" --need_lock
 
 #=================================================
 # GENERIC FINALIZATION

+ 5 - 2
scripts/upgrade

@@ -97,8 +97,11 @@ systemctl reload nginx
 # main service
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock
 
-# checker service
-yunohost service add $service_checker_name --description "Makes sure that the VPN service is running" --need_lock
+# checker service (this service was previously integrated in yunohost but we do not do this anymore)
+if ynh_exec_warn_less yunohost service status $service_checker_name >/dev/null
+then
+    yunohost service remove $service_checker_name
+fi
 
 # Reload systemd configuration