Cleanup redundant psk handling code in wpa_supplicant.sh.
(I sent this one to openwrt-devel before, but I am resending it as part of
this series because the next patch will also edit wpa_supplicant.sh).

Signed-off-by: Stijn Tintel <st...@linux-ipv6.be>
---
 package/hostapd/files/wpa_supplicant.sh |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/package/hostapd/files/wpa_supplicant.sh 
b/package/hostapd/files/wpa_supplicant.sh
index 97a0082..522d423 100644
--- a/package/hostapd/files/wpa_supplicant.sh
+++ b/package/hostapd/files/wpa_supplicant.sh
@@ -42,22 +42,17 @@ wpa_supplicant_setup_vif() {
                *psk*)
                        key_mgmt='WPA-PSK'
                        config_get_bool usepassphrase "$vif" passphrase 1
+                       if [ "$usepassphrase" = "1" ]; then
+                               passphrase="psk=\"${key}\""
+                       else
+                               passphrase="psk=${key}"
+                       fi
                        case "$enc" in
                                *psk2*)
                                        proto='proto=RSN'
-                                       if [ "$usepassphrase" = "1" ]; then
-                                               passphrase="psk=\"${key}\""
-                                       else
-                                               passphrase="psk=${key}"
-                                       fi
                                ;;
                                *psk*)
                                        proto='proto=WPA'
-                                       if [ "$usepassphrase" = "1" ]; then
-                                               passphrase="psk=\"${key}\""
-                                       else
-                                               passphrase="psk=${key}"
-                                       fi
                                ;;
                        esac
                ;;
-- 
1.6.4.4

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to