Skip to content

Commit

Permalink
support unicode and space in wifi essid
Browse files Browse the repository at this point in the history
  • Loading branch information
fuji246 committed Mar 10, 2020
1 parent 7f220d3 commit 76feb50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stage2/02-net-tweaks/files/wifi_switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
EOF"
sudo sh -c "wpa_passphrase $1 $2 >> /etc/wpa_supplicant/wpa_supplicant.conf"
sudo sh -c "wpa_passphrase \"$1\" $2 >> /etc/wpa_supplicant/wpa_supplicant.conf"
ssid=$(printf "$1" | xxd -ps -)
sudo sed -i "s/ssid=.*/ssid=$ssid/" /etc/wpa_supplicant/wpa_supplicant.conf

}

switch_ap_mode() {
Expand Down Expand Up @@ -71,7 +74,7 @@ case "$1" in
sudo rm /etc/network/interfaces
sudo ln -sf /etc/network/interfaces.client /etc/network/interfaces
sudo ip addr flush wlan0
wpa_config $2 $3
wpa_config "$2" $3
sudo systemctl enable wpa_supplicant.service
sudo systemctl restart wpa_supplicant.service
sudo systemctl restart networking.service
Expand Down

0 comments on commit 76feb50

Please sign in to comment.