Browse Source

fix conditions

HgO 1 year ago
parent
commit
afb71e2ffb
1 changed files with 6 additions and 2 deletions
  1. 6 2
      scripts/_common.sh

+ 6 - 2
scripts/_common.sh

@@ -126,7 +126,9 @@ function convert_cube_file()
   jq --raw-output ".openvpn_add[]" "${config_file}" >> "$config_template"
 
   # Temporarily tweak sever_proto for template hydratation
-  [ "$server_proto" == tcp ] && server_proto=tcp-client
+  if [ "$server_proto" == tcp ]; then
+    server_proto=tcp-client
+  fi
 
   # Define other needed vars for template hydratation
   [ -e "$crt_client_key" ] && cert_comment="" || cert_comment="#"
@@ -137,7 +139,9 @@ function convert_cube_file()
   # Actually generate/hydrate the final configuration
   ynh_add_config --template="$config_template" --destination="$config_file"
 
-  [ "$server_proto" == tcp-client ] && server_proto=tcp
+  if [ "$server_proto" == tcp-client ]; then
+    server_proto=tcp
+  fi
 }
 
 function convert_ovpn_file()