Fixed a bug affecting slow system and AP services.

The bug was caused by a constant wait time, rather than dynamic.
The bug was more likey to affect the airbase-ng service.
This commit is contained in:
Matias Barcenas 2017-08-12 22:36:36 -05:00
parent 1aa3d96c8a
commit 8e0a37218b
2 changed files with 16 additions and 12 deletions

View File

@ -10,10 +10,6 @@ VIAP=$WIAccessPoint
# and creates a separate interface, atX, for dhcpd.
VIAPAddress="$VIGWNetwork.2"
VIAPRouteDelay=5
#APServiceConfPath="$FLUXIONWorkspacePath/APService.conf"
function ap_stop() {
killall airbase-ng &> $FLUXIONOutputDevice
@ -41,7 +37,13 @@ function ap_prep() {
function ap_start() {
xterm $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "FLUXION AP Service [airbase-ng]" -e airbase-ng -P -e $APTargetSSID -c $APTargetChannel -a $APRogueMAC $VIAP &
sleep $VIAPRouteDelay; ap_route
# Wait till airebase-ng has started and created the extra virtual interface.
while [ ! $(ps a | awk '$5~/^airbase-ng/ && $0~/'"$APRogueMAC"'/{print $1}') ]
do sleep 1
done
ap_route
}
# FLUXSCRIPT END

View File

@ -10,10 +10,6 @@ VIAP=$WIAccessPoint
# to master, which is supported by dhcpd.
VIAPAddress=$VIGWAddress
VIAPRouteDelay=5
APServiceConfPath="$FLUXIONWorkspacePath/APService.conf"
function ap_stop() {
killall hostapd &> $FLUXIONOutputDevice
@ -50,7 +46,7 @@ interface=$VIAP
driver=nl80211
ssid=$APTargetSSID
channel=$APTargetChannel\
" > "$APServiceConfPath"
" > "$APRogueMAC-hostapd.conf"
# Spoof virtual interface MAC address.
ifconfig $VIAP down
@ -64,8 +60,14 @@ channel=$APTargetChannel\
}
function ap_start() {
xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "FLUXION AP Service [hostapd]" -e hostapd "$APServiceConfPath" &
sleep $VIAPRouteDelay; ap_route
xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "FLUXION AP Service [hostapd]" -e hostapd "$APRogueMAC-hostapd.conf" &
# Wait till hostapd has started and its virtual interface is ready.
while [ ! $(ps a | awk '$5~/^hostapd/ && $0~/'"$APRogueMAC-hostapd.conf"'/{print $1}') ]
do sleep 1
done
ap_route
}
# FLUXSCRIPT END