Browse Source

use dns method as yunohost for empty dns settings

HgO 1 year ago
parent
commit
f904d2f323
1 changed files with 7 additions and 2 deletions
  1. 7 2
      scripts/config

+ 7 - 2
scripts/config

@@ -238,9 +238,14 @@ ynh_app_config_validate() {
         crt_client="$(read_cube $config_file crt_client)"
         crt_client_key="$(read_cube $config_file crt_client_key)"
         crt_client_ta="$(read_cube $config_file crt_client_ta)"
-        dns_method="custom"
-        nameservers="$dns0,$dns1"
 
+        if [[ -z $dns0 && -z $dns1 ]]; then
+          dns_method="yunohost"
+        else
+          dns_method="custom"
+          nameservers="$dns0,$dns1"
+        fi
+        
         # Build specific OVPN template
         tmp_dir=$(dirname "${config_file}")
         cp -f /etc/yunohost/apps/vpnclient/conf/openvpn_client.conf.tpl $tmp_dir/client.conf.tpl