From 53717b095e7b0ef8c9b374a921280acaf195981a Mon Sep 17 00:00:00 2001 From: Neythen Treloar <33317183+zcqsntr@users.noreply.github.com> Date: Thu, 16 Dec 2021 14:49:34 +0000 Subject: [PATCH] Update server.py --- server.py | 7 +++++++ 1 file changed, 7 insertions(+) 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))