Browse Source

install ipv6-send-over-tun script in config apply, not in set otherwise the setting isn't stored

HgO 5 months ago
parent
commit
d9b079bd78
1 changed files with 8 additions and 9 deletions
  1. 8 9
      scripts/config

+ 8 - 9
scripts/config

@@ -191,15 +191,6 @@ set__login_passphrase() {
     :
 }
 
-set__ip6_send_over_tun_enabled() {
-  if [[ ${ip6_send_over_tun_enabled} -eq 1 ]]; then
-    install -b -o root -g root -m 0755 ../conf/optional-scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun /etc/openvpn/scripts/route-up.d/
-    install -b -o root -g root -m 0755 ../conf/optional-scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun /etc/openvpn/scripts/route-down.d/
-  else
-    ynh_secure_remove /etc/openvpn/scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun
-    ynh_secure_remove /etc/openvpn/scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun
-  fi
-}
 
 #=================================================
 # OVERWRITING VALIDATE STEP
@@ -251,6 +242,14 @@ ynh_app_config_apply() {
 
     _ynh_app_config_apply
 
+    if [[ ${ip6_send_over_tun_enabled} -eq 1 ]]; then
+        install -b -o root -g root -m 0755 ../conf/optional-scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun /etc/openvpn/scripts/route-up.d/
+        install -b -o root -g root -m 0755 ../conf/optional-scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun /etc/openvpn/scripts/route-down.d/
+    else
+        ynh_secure_remove /etc/openvpn/scripts/route-up.d/50-vpnclient-set-ipv6-send-over-tun
+        ynh_secure_remove /etc/openvpn/scripts/route-down.d/50-vpnclient-unset-ipv6-send-over-tun
+    fi
+
     set_permissions /etc/openvpn/client.conf
     set_permissions /etc/openvpn/keys/ca-server.crt
     set_permissions /etc/openvpn/keys/user.crt