Skip to content

Commit

Permalink
Merge pull request #1680 from warpdesign/fix-passphrase-with-equal-ch…
Browse files Browse the repository at this point in the history
…aracter

Use sed instead of grep+cut to capture the passphrase
  • Loading branch information
billz authored Oct 22, 2024
2 parents ba0bff9 + 0bb8a54 commit bf22668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/modules/ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

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():
return subprocess.run("cat /etc/hostapd/hostapd.conf | grep interface= | cut -d'=' -f2 | head -1", shell=True, capture_output=True, text=True).stdout.strip()
Expand Down

0 comments on commit bf22668

Please sign in to comment.