From 7d0ddc223d68fcdbbc47d37dee23517bfe693ce4 Mon Sep 17 00:00:00 2001 From: Rocket13011 Date: Wed, 4 Oct 2023 10:23:46 +0200 Subject: [PATCH] fix ssid avec espace --- core/class/luna.class.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/class/luna.class.php b/core/class/luna.class.php index 57a2df6..eb26574 100644 --- a/core/class/luna.class.php +++ b/core/class/luna.class.php @@ -364,27 +364,27 @@ public static function saveWifi($interface = 1, $data) { } if($wifiMode == "client"){ log::add(__CLASS__, 'debug', 'save wifi >>bbbb'.luna::convertIP($wifiIp, $wifiMask)); - shell_exec('sudo nmcli dev wifi connect '.$wifiSsid.' password '.$wifiPassword); - shell_exec('sudo nmcli con down '.$wifiSsid); - shell_exec('sudo nmcli con modify '.$wifiSsid.' ifname wlan'.$device); + shell_exec('sudo nmcli dev wifi connect "'.$wifiSsid.'" password "'.$wifiPassword.'"'); + shell_exec('sudo nmcli con down "'.$wifiSsid.'"'); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ifname wlan'.$device); if($typeAdressage == 'dhcp'){ - shell_exec('sudo nmcli con modify '.$wifiSsid.' ipv4.method auto'); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ipv4.method auto'); if($wifiDnsOpt!=""){ - shell_exec('sudo nmcli con modify '.$wifiSsid.' ipv4.ignore-auto-dns yes'); - shell_exec('sudo nmcli con modify '.$wifiSsid.' ipv4.dns '.$wifiDnsOpt); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ipv4.ignore-auto-dns yes'); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ipv4.dns '.$wifiDnsOpt); }else{ - shell_exec('sudo nmcli con modify '.$wifiSsid.' ipv4.ignore-auto-dns no'); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ipv4.ignore-auto-dns no'); } - shell_exec('sudo nmcli con up '.$wifiSsid); + shell_exec('sudo nmcli con up "'.$wifiSsid.'"'); }else{ - shell_exec('sudo nmcli con modify '.$wifiSsid.' ipv4.addresses '.luna::convertIP($wifiIp, $wifiMask).' ipv4.gateway '.$wifiRouter.' ipv4.dns '.$wifiDns.' ipv4.method manual'); - shell_exec('sudo nmcli con modify '.$wifiSsid.' ifname wlan'.$device); - shell_exec('sudo nmcli con up '.$wifiSsid); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ipv4.addresses '.luna::convertIP($wifiIp, $wifiMask).' ipv4.gateway '.$wifiRouter.' ipv4.dns '.$wifiDns.' ipv4.method manual'); + shell_exec('sudo nmcli con modify "'.$wifiSsid.'" ifname wlan'.$device); + shell_exec('sudo nmcli con up "'.$wifiSsid.'"'); } sleep(5); }else if($wifiMode == "hotspot"){ log::add(__CLASS__, 'debug', 'save wifi >>hotspot'); - shell_exec('sudo nmcli con add type wifi ifname wlan'.$device.' con-name Hostspot-wlan'.$device.' autoconnect yes ssid '.$wifiHotspotName); + shell_exec('sudo nmcli con add type wifi ifname wlan'.$device.' con-name Hostspot-wlan'.$device.' autoconnect yes ssid "'.$wifiHotspotName.'"'); shell_exec('sudo nmcli con modify Hostspot-wlan'.$device.' 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared'); shell_exec('sudo nmcli con modify Hostspot-wlan'.$device.' wifi-sec.key-mgmt wpa-psk'); shell_exec('sudo nmcli con modify Hostspot-wlan'.$device.' wifi-sec.psk "'.$wifiHotspotPwd.'"');