Skip to content

Commit

Permalink
corrected the config file layout
Browse files Browse the repository at this point in the history
  • Loading branch information
emrysr committed Jun 18, 2018
1 parent 1ffac00 commit ec2302a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wifi.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ public function setconfig($networks)
{
if (!empty($network->PSK) && (strlen($network->PSK) > 8 && strlen($network->PSK) < 64))
{
$config .= hash_pbkdf2("sha1",$network->PSK, $ssid, 4096, 64).PHP_EOL;
$psk = hash_pbkdf2("sha1",$network->PSK, $ssid, 4096, 64).PHP_EOL;
$config .= sprintf("network={
ssid=\"%s\"
#psk=\"%s\"
psk=%s
}", $ssid, $network->PSK, $psk);
}
else
{
Expand Down

0 comments on commit ec2302a

Please sign in to comment.