diff --git a/wifi.php b/wifi.php index 8598dfa..5a67a1b 100644 --- a/wifi.php +++ b/wifi.php @@ -225,7 +225,10 @@ public function setconfig($networks,$country_code) } } - exec("echo '$config' > /tmp/wifidata",$return); + $file = fopen('/tmp/wifidata', 'w'); + fwrite($file, $config); + fclose($file); + system('sudo cp /tmp/wifidata /etc/wpa_supplicant/wpa_supplicant.conf',$returnval); if (file_exists($settings['openenergymonitor_dir']."/data/wifiAP-enabled")) {