Skip to content

Commit

Permalink
#18 Xiaomi QR format update
Browse files Browse the repository at this point in the history
  • Loading branch information
kokoye2007 committed May 21, 2023
1 parent 529382d commit 98545b4
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions wifi-qr
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,15 @@ call_wifi_scan() {
WIFIQRDATA="${wifiqrdata}"

# Extract the SSID
# QSSID=$(echo "$WIFIQRDATA" | sed -n 's/.*S:\(.*\);T.*/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' )
QSSID=$(echo "$WIFIQRDATA" | sed -n 's/.*S:\([^;]*\)\(;[PHT]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' )

# Extract the security type
# QTYPE=$(echo "$WIFIQRDATA" | sed -n 's/.*T:\(.*\);P.*/\1/p')
QTYPE=$(echo "$WIFIQRDATA" | sed -n 's/.*T:\([^;]*\)\(;[PHS]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' )

# Extract the password
if [[ $WIFIQRDATA == *';H:'* ]]; then
# QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*;P:\(.*\);H:.*/\1/p' | sed 's/\\:/:/g' | sed 's/\\\([\\;,:"\]\)/\1/g' )
QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*P:\([^;]*\)\(;[TSH]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' )
else
# QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*;P:\(.*\);;.*/\1/p' | sed 's/\\:/:/g' | sed 's/\\\([\\;,:"\]\)/\1/g' )
QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*P:\([^;]*\)\(;[TS]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' )
fi

Expand Down

0 comments on commit 98545b4

Please sign in to comment.