forked from amamory/tutos
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added files to configure the board as access point
- Loading branch information
1 parent
31145bf
commit 6b64684
Showing
9 changed files
with
944 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
pid=$(pgrep -x wpa_supplicant) #kill wpa_supplicant if it is already running | ||
|
||
if [ ! -z "$pid" ]; then | ||
kill -sigterm $pid | ||
fi | ||
|
||
pid=$(pgrep -x dhclient) #kill dhclient if it is already running | ||
|
||
if [ ! -z "$pid" ]; then | ||
kill -sigterm $pid | ||
fi | ||
|
||
pid=$(pgrep -x hostapd) #kill Hostapd | ||
|
||
if [ ! -z "$pid" ]; then | ||
kill -sigterm $pid | ||
fi | ||
|
||
sleep 1 | ||
hostapd -B /etc/hostapd/hostapd.conf | ||
|
||
rv=$(echo $?) # checking return status hostapd | ||
|
||
if [ $rv -ne 0 ]; then | ||
echo "could not start hostapd" | ||
exit 1 | ||
else | ||
echo "Access Point mode started" | ||
fi | ||
|
||
exit 0 |
Oops, something went wrong.