$ cat wpa                                                                         
#!/bin/sh
i1=wlp8s0
i2=wlp2s0

if [ -f  /run/wpa_supplicant/$i1] ; then
  doas pkill wpa_supplicant
  doas wpa_supplicant -B -D nl80211 -i $i2 -c /etc/wpa_supplicant.conf
elif [ -f /run/wpa_supplicant/$i2 ; then
  doas pkill wpa_supplicant
  doas wpa_supplicant -B -D nl80211 -i $i1 -c /etc/wpa_supplicant.conf
fi
