wpa_supplicant.conf.tpl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ctrl_interface=/var/run/wpa_supplicant
  2. ap_scan=1
  3. update_config=1
  4. {{- range $key, $value := .}}
  5. network={
  6. ssid="{{$value.SSID}}"
  7. {{- if gt (len $value.PSK) 0}}
  8. psk="{{$value.PSK}}"
  9. {{- end}}
  10. {{- if gt (len $value.KeyMgmt) 0}}
  11. key_mgmt={{$value.KeyMgmt}}
  12. {{- end}}
  13. {{- if $value.ScanSSID}}
  14. scan_ssid={{$value.ScanSSID}}
  15. {{- end}}
  16. {{- if $value.Priority}}
  17. priority={{$value.Priority}}
  18. {{- end}}
  19. {{- if gt (len $value.Pairwise) 0}}
  20. pairwise={{$value.Pairwise}}
  21. {{- end}}
  22. {{- if gt (len $value.Group) 0}}
  23. group={{$value.Group}}
  24. {{- end}}
  25. {{- if gt (len $value.Eap) 0}}
  26. eap={{$value.Eap}}
  27. {{- end}}
  28. {{- if gt (len $value.Identity) 0}}
  29. identity="{{$value.Identity}}"
  30. {{- end}}
  31. {{- if gt (len $value.AnonymousIdentity) 0}}
  32. anonymous_identity="{{$value.AnonymousIdentity}}"
  33. {{- end}}
  34. {{- if $value.EapolFlags}}
  35. eapol_flags={{$value.EapolFlags}}
  36. {{- end}}
  37. {{- if gt (len $value.Password) 0}}
  38. password="{{$value.Password}}"
  39. {{- end}}
  40. {{- range $i, $v := $value.Phases}}
  41. phase{{addFunc $i 1}}="{{$v}}"
  42. {{- end}}
  43. {{- range $i, $v := $value.CaCerts}}
  44. {{- if eq $i 0}}
  45. ca_cert="{{$v}}"
  46. {{- else}}
  47. ca_cert{{addFunc $i 1}}="{{$v}}"
  48. {{- end}}
  49. {{- end}}
  50. {{- range $i, $v := $value.ClientCerts}}
  51. {{- if eq $i 0}}
  52. client_cert="{{$v}}"
  53. {{- else}}
  54. client_cert{{addFunc $i 1}}="{{$v}}"
  55. {{- end}}
  56. {{- end}}
  57. {{- range $i, $v := $value.PrivateKeys}}
  58. {{- if eq $i 0}}
  59. private_key="{{$v}}"
  60. {{- else}}
  61. private_key{{addFunc $i 1}}="{{$v}}"
  62. {{- end}}
  63. {{- end}}
  64. {{- range $i, $v := $value.PrivateKeyPasswds}}
  65. {{- if eq $i 0}}
  66. private_key_passwd="{{$v}}"
  67. {{- else}}
  68. private_key{{addFunc $i 1}}_passwd="{{$v}}"
  69. {{- end}}
  70. {{- end}}
  71. }
  72. {{- end}}