From: Calin Crisan Date: Sun, 4 Dec 2016 11:18:58 +0000 (+0200) Subject: wifictl: brackets in PSKs are now supported X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=7dd8834bcebbca98361ffcbbb493b0317e2d4882;p=motioneye-debian wifictl: brackets in PSKs are now supported --- diff --git a/motioneye/wifictl.py b/motioneye/wifictl.py index 5347458..3066ece 100644 --- a/motioneye/wifictl.py +++ b/motioneye/wifictl.py @@ -53,13 +53,13 @@ def _get_wifi_settings(): if line.startswith('#'): continue - if '{' in line: + if line.endswith('{'): in_section = True - elif '}' in line: + elif line.startswith('}'): in_section = False break - + elif in_section: m = re.search('ssid\s*=\s*"(.*?)"', line) if m: @@ -125,10 +125,10 @@ def _set_wifi_settings(s): i += 1 continue - if '{' in line: + if line.endswith('{'): in_section = True - - elif '}' in line: + + elif line.startswith('}'): in_section = False if enabled and ssid and not found_ssid: lines.insert(i, ' ssid="' + ssid + '"\n')