Rat-OS / RatOS-configurator

The RatOS Configurator
11 stars 19 forks source link

use regex to remove unencrypted wifi pw #20

Closed funtimeerror closed 2 months ago

funtimeerror commented 2 months ago

use regex to remove unencrypted wifi pw test validation of encrypted psk attached

pi@ratos:~ $ wpa_passphrase $SSID $PASS
network={
        ssid="test"
        #psk="testdummypass"
        psk=ea20d311e6ad6a9175ef7f77d0947b85e2b30fb215274b4da15137707fe47f1e
}
pi@ratos:~ $ NETWORK=$(sh -c "wpa_passphrase '$SSID' '$PASS'|sed '/^\s*#psk=\".*\"$/d'")
pi@ratos:~ $ echo $NETWORK
network={ ssid="test" psk=ea20d311e6ad6a9175ef7f77d0947b85e2b30fb215274b4da15137707fe47f1e }
pi@ratos:~ $ NETWORK=$(sh -c "wpa_passphrase '$SSID' '$PASS'")
pi@ratos:~ $ echo $NETWORK
network={ ssid="test" #psk="testdummypass" psk=ea20d311e6ad6a9175ef7f77d0947b85e2b30fb215274b4da15137707fe47f1e }
funtimeerror commented 2 months ago

fixes Rat-OS/RatOS/issues/152