-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helpers to start/stop wifi on several distros
- Loading branch information
Showing
3 changed files
with
14 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,7 @@ | ||
#!/bin/bash | ||
|
||
./kill-wpa.sh | ||
|
||
. miracle-utils.sh | ||
|
||
ETHER_NAMES=$(find_choosable_networknames) | ||
|
||
ETHER_COUNT=$(echo "$ETHER_NAMES" | wc -l) | ||
|
||
if [ 0 = $ETHER_COUNT ] | ||
then | ||
echo There is no net devices available | ||
exit 1 | ||
elif [ 1 = $ETHER_COUNT ] | ||
then | ||
ETHERNAME="$ETHER_NAMES" | ||
elif [ 2 -le $ETHER_COUNT ] | ||
then | ||
echo choose device for normal connection: | ||
QUIT="exit" | ||
select et_name in $ETHER_NAMES $QUIT | ||
do | ||
case $et_name | ||
in | ||
"$QUIT") | ||
exit | ||
;; | ||
"") | ||
if [ "$REPLY" = $QUIT ] | ||
then | ||
exit | ||
else | ||
echo unknow $REPLY | ||
fi | ||
;; | ||
*) | ||
ETHERNAME=$et_name | ||
break | ||
;; | ||
esac | ||
done | ||
fi | ||
|
||
# default path for config file | ||
CONFIG_FILE=${1:-/run/network/wpa_supplicant_${ETHERNAME}.conf} | ||
|
||
|
||
echo starting wpa_supplicant for normal connection | ||
if check_ubuntu_distro || check_debian_distro | ||
then | ||
start_ubuntu_network_manager | ||
sudo wpa_supplicant -B -u -s -O /var/run/wpa_supplicant | ||
else | ||
sudo wpa_supplicant -B -u -P /run/wpa_supplicant_${ETHERNAME}pid -i ${ETHERNAME} -D nl80211 -c$CONFIG_FILE | ||
fi | ||
./kill-wpa.sh | ||
|
||
start_network_manager |