diff --git a/server.py b/server.py index c48544f..48cc940 100755 --- a/server.py +++ b/server.py @@ -282,6 +282,13 @@ def edit_wpa_sup(country, ssid, pwd): wpa_lines = wpa_lines[0:3] print(wpa_lines) + # create new file from scratch + wpa_lines = [] + wpa_lines.append('ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev') + wpa_lines.append('update_config=1') + wpa_lines.append('country={}\n'.format(country)') + + wpa_lines.append('\n') wpa_lines.append('network={\n') wpa_lines.append('\tssid="{}"\n'.format(ssid))