mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Use sed instead of grep+cut to capture the passphrase
Current method would crop any passphrase containing an '=' sign. For eg. wpa_passwphrase=Foo=Bar would return 'Foo' instead of 'Foo=Bar'.
This commit is contained in:
parent
ba0bff9b9c
commit
0bb8a5400e
@ -32,7 +32,7 @@ def ieee80211n():
|
|||||||
return subprocess.run("cat /etc/hostapd/hostapd.conf | grep ieee80211n= | cut -d'=' -f2", shell=True, capture_output=True, text=True).stdout.strip()
|
return subprocess.run("cat /etc/hostapd/hostapd.conf | grep ieee80211n= | cut -d'=' -f2", shell=True, capture_output=True, text=True).stdout.strip()
|
||||||
|
|
||||||
def wpa_passphrase():
|
def wpa_passphrase():
|
||||||
return subprocess.run("cat /etc/hostapd/hostapd.conf | grep wpa_passphrase= | cut -d'=' -f2", shell=True, capture_output=True, text=True).stdout.strip()
|
return subprocess.run("sed -En 's/wpa_passphrase=(.*)/\1/p' /etc/hostapd/hostapd.conf", shell=True, capture_output=True, text=True).stdout.strip()
|
||||||
|
|
||||||
def interface():
|
def interface():
|
||||||
return subprocess.run("cat /etc/hostapd/hostapd.conf | grep interface= | cut -d'=' -f2 | head -1", shell=True, capture_output=True, text=True).stdout.strip()
|
return subprocess.run("cat /etc/hostapd/hostapd.conf | grep interface= | cut -d'=' -f2 | head -1", shell=True, capture_output=True, text=True).stdout.strip()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user