1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/wpa_supplicant/rocknet_wpa.sh
3 # Copyright (C) 2004 - 2024 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
14 local ssid
=${wpa_ssid[$if]}
15 local psk
=${wpa_psk[$if]}
16 # add quotes if necessary
17 [[ "$ssid" != \"*\" ]] && ssid
="\"$ssid\""
18 [[ "$psk" != \"*\" ]] && psk
="\"$psk\""
20 cat > /var
/run
/wpa_supplicant-
$if.conf
<<EOT
21 ctrl_interface=/var/run/wpa_supplicant
30 if isfirst
"wpa_$if"; then
31 addcode up
5 2 "wpa_write_conf $if"
32 addcode up
5 3 "wpa_supplicant -Dnl80211,wext -i$if -B \
33 -c/var/run/wpa_supplicant-$if.conf -P/var/run/wpa_supplicant-$if.pid"
34 addcode down
5 2 "rm -f /var/run/wpa_supplicant-$if.{pid,conf}"
35 addcode down
5 3 "kill \$(cat /var/run/wpa_supplicant-$if.pid)"