Browse Source

fix run-parts missing operand

HgO 1 year ago
parent
commit
de28b2547a
6 changed files with 11 additions and 2 deletions
  1. 2 2
      conf/openvpn_client.conf.tpl
  2. 3 0
      conf/openvpn_run-parts.sh
  3. 1 0
      scripts/_common.sh
  4. 1 0
      scripts/backup
  5. 3 0
      scripts/remove
  6. 1 0
      scripts/restore

+ 2 - 2
conf/openvpn_client.conf.tpl

@@ -42,5 +42,5 @@ route-ipv6 2000::/3
 redirect-gateway def1 bypass-dhcp
 
 script-security 2
-route-up "/usr/bin/run-parts /etc/openvpn/scripts/route-up.d"
-down "/usr/bin/run-parts /etc/openvpn/scripts/route-down.d"
+route-up "/etc/openvpn/scripts/run-parts.sh route-up"
+down "/etc/openvpn/scripts/run-parts.sh route-down"

+ 3 - 0
conf/openvpn_run-parts.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/usr/bin/run-parts -v /etc/openvpn/scripts/$1

+ 1 - 0
scripts/_common.sh

@@ -39,6 +39,7 @@ function vpnclient_deploy_files_and_services()
   mkdir -pm 0775 /etc/openvpn/scripts
   mkdir -pm 0775 /etc/openvpn/scripts/route-up.d
   mkdir -pm 0775 /etc/openvpn/scripts/route-down.d
+  install -b -o root -g root -m 0755 ../conf/openvpn_run-parts.sh /etc/openvpn/scripts/run-parts.sh
 
   #=================================================
 

+ 1 - 0
scripts/backup

@@ -36,6 +36,7 @@ ynh_backup "/etc/yunohost/hooks.d/90-vpnclient.tpl"
 
 ynh_backup "/etc/openvpn/client.conf.tpl"
 ynh_backup "/etc/openvpn/keys/"
+ynh_backup "/etc/openvpn/scripts/run-parts.sh"
 
 ynh_backup "/usr/local/bin/$service_name"
 ynh_backup "/usr/local/bin/$service_checker_name.sh"

+ 3 - 0
scripts/remove

@@ -64,6 +64,9 @@ ynh_print_info "Removing openvpn configuration"
 ynh_secure_remove /etc/openvpn/client.conf
 ynh_secure_remove /etc/openvpn/client.conf.tpl
 
+# Remove openvpn script
+ynh_secure_remove /etc/openvpn/scripts/run-parts.sh
+
 # Remove YunoHost hook
 ynh_secure_remove /etc/yunohost/hooks.d/90-vpnclient.tpl
 

+ 1 - 0
scripts/restore

@@ -34,6 +34,7 @@ ynh_restore_file "/etc/yunohost/hooks.d/90-vpnclient.tpl"
 
 ynh_restore_file "/etc/openvpn/client.conf.tpl"
 ynh_restore_file "/etc/openvpn/keys/"
+ynh_restore_file "/etc/openvpn/scripts/run-parts.sh"
 
 ynh_restore_file "/usr/local/bin/$service_name"
 ynh_restore_file "/usr/local/bin/$service_checker_name.sh"