Skip to content

Commit 51eef52

Browse files
author
Ritwick DSouza
committed
[raspbian] Added support for WEP Station mode
1 parent 52d7060 commit 51eef52

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

netjsonconfig/backends/raspbian/converters/wireless.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,11 @@ def _get_encryption(self, wireless):
8888
'priv_key': encryption.get('priv_key', None),
8989
'priv_key_pwd': encryption.get('priv_key_pwd', None)
9090
})
91+
elif 'wep' in protocol:
92+
new_encryption.update({
93+
'protocol': 'wep',
94+
'method': method,
95+
'option': encryption.get('options', None).split('_')[1],
96+
'key': encryption.get('key', None)
97+
})
9198
return new_encryption

netjsonconfig/backends/raspbian/templates/wpasupplicant.jinja2

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@
3434
priv_key_pwd="{{ encryption.priv_key_pwd }}"
3535
{% endif %}
3636
{% endif%}
37-
{% else %}
37+
{% elif 'wep' in wireless.encryption.protocol %}
3838
key_mgmt=NONE
39+
wep_key0="{{ wireless.encryption.key }}"
40+
{% if wireless.encryption.option == 'shared' %}
41+
auth_algs=shared
3942
{% endif %}
40-
{% if 'wep' in wireless.encryption %}
41-
{# WEP Config Here#}
43+
{% else %}
44+
key_mgmt=NONE
4245
{% endif %}
4346
}
4447

0 commit comments

Comments
 (0)