1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-12 15:51:59 +00:00

miraclecast starts wpa_supplicant

relates #35
This commit is contained in:
albfan 2015-07-29 21:05:01 +02:00
parent 81e71c8387
commit e83ded02de
2 changed files with 2 additions and 82 deletions

View file

@ -81,10 +81,8 @@ Steps to use it as sink:
$ sudo kill -9 $(ps -ef | grep wpa_supplican[t] | awk '{print $2}')
# now you can use `res/kill-wpa.sh`
2. start wpa with config for miraclecast
$ sudo wpa_supplicant -dd -B -iwlp3s0 -Dnl80211 -c wpa.conf
# or `res/miracle-wifi.sh`
>Remember to save your config to use with `res/normal-wifi.sh`
>it will be easily located with `ps -ef | grep wpa_supplicant` on `-c` option.
2. launch wifi daemon

View file

@ -1,78 +0,0 @@
#!/bin/bash
# debug {{{
eval SCRIPT_DEBUG="\$$(basename $0 | tr .- __ )_DEBUG"
SCRIPT_DEBUG=${SCRIPT_DEBUG:--1}
if [ "$SCRIPT_DEBUG" -ge 1 ]
then
set -x
fi
if [ "$SCRIPT_DEBUG" -ge 10 ]
then
set -v
fi
#}}}
./kill-wpa.sh
. miracle-utils.sh
WIFI_NAMES=$(find_wireless_connected_network_interfaces)
if [ "$WIFI_NAMES" == "" ]
then
WIFI_COUNT=0
else
WIFI_COUNT=$(echo "$WIFI_NAMES" | wc -l)
fi
if [ 0 = $WIFI_COUNT ]
then
echo There is no wireless devices connected
# choose from any existing wireless interface
WIFI_NAMES=$(find_wireless_network_interfaces)
if [ "$WIFI_NAMES" == "" ]
then
WIFI_COUNT=0
else
WIFI_COUNT=$(echo "$WIFI_NAMES" | wc -l)
fi
fi
if [ 0 = $WIFI_COUNT ]
then
echo There is no avaliable wireless devices
exit 1
elif [ 1 = $WIFI_COUNT ]
then
WIFI_NAME="$WIFI_NAMES"
elif [ 2 -le $WIFI_COUNT ]
then
echo Choose wireless device:
PS3="device: "
QUIT="exit"
select wifi_name in $WIFI_NAMES $QUIT
do
case $wifi_name
in
"$QUIT")
exit
;;
"")
if [ "$REPLY" = $QUIT ]
then
exit
else
echo unknow $REPLY
fi
;;
*)
WIFI_NAME=$wifi_name
break
;;
esac
done
fi
echo starting wpa_supplicant for miraclecast on $WIFI_NAME
sudo wpa_supplicant -dd -B -u -i$WIFI_NAME -Dnl80211 -c$(dirname $0)/wpa.conf