]> www.vanbest.org Git - motioneye-debian/commitdiff
wifictl: brackets in PSKs are now supported
authorCalin Crisan <ccrisan@gmail.com>
Sun, 4 Dec 2016 11:18:58 +0000 (13:18 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 4 Dec 2016 11:18:58 +0000 (13:18 +0200)
motioneye/wifictl.py

index 53474580d3aae1aab9e0f11674ec41e8f5c46d05..3066ece645e67f1a4dd7ff879a9ab1ef4b2429ef 100644 (file)
@@ -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')