Fixed interface restoration bug & enhanced notices.

This commit is contained in:
Matias Barcenas 2018-01-19 13:59:15 -06:00
parent 51c35d470f
commit 9fce798206
2 changed files with 18 additions and 13 deletions

23
fluxion
View File

@ -240,7 +240,7 @@ fluxion_startup() {
sleep 0.1 sleep 0.1
local -r versionInfo="${CSRed}FLUXION $FLUXIONVersion$CClr" local -r versionInfo="${CSRed}FLUXION $FLUXIONVersion$CClr"
local -r revisionInfo="(rev. $CSBlu$FLUXIONRevision$CClr)" local -r revisionInfo="(rev. $CSBlu$FLUXIONRevision$CClr)"
local -r credits="${CYel}by$CWht FluxionNetwork" local -r credits="by$CCyn FluxionNetwork$CClr"
format_center_literals "$versionInfo $revisionInfo $credits" format_center_literals "$versionInfo $revisionInfo $credits"
echo -e "$FormatCenterLiterals" echo -e "$FormatCenterLiterals"
@ -315,13 +315,10 @@ fluxion_shutdown() {
# If allocated interfaces exist, deallocate them now. # If allocated interfaces exist, deallocate them now.
if [ ${#FluxionInterfaces[@]} -gt 0 ]; then if [ ${#FluxionInterfaces[@]} -gt 0 ]; then
echo -e "$FLUXIONVLine $FLUXIONRemovingExtraWINotice"
local interface local interface
for interface in "${!FluxionInterfaces[@]}"; do for interface in "${!FluxionInterfaces[@]}"; do
# Only deallocate fluxion or airmon-ng created interfaces. # Only deallocate fluxion or airmon-ng created interfaces.
if [[ "$interface" == "flux"* || "$interface" == *"mon"* ]]; then if [[ "$interface" == "flux"* || "$interface" == *"mon"* ]]; then
echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingMonitorNotice$CGrn $interface$CClr"
fluxion_deallocate_interface $interface fluxion_deallocate_interface $interface
fi fi
done done
@ -680,13 +677,14 @@ fluxion_deallocate_interface() { # Release interfaces
# Assure the interface is in the allocation table. # Assure the interface is in the allocation table.
if [ ! "$newIdentifier" ]; then return 2; fi if [ ! "$newIdentifier" ]; then return 2; fi
if interface_is_wireless $oldInterface; then local interfaceIdentifier=$newIdentifier
# Unblock interfaces to make them available. echo -e "$CWht[$CSRed-$CWht] "$(
echo -e "$FLUXIONVLine $FLUXIONUnblockingWINotice" io_dynamic_output "$FLUXIONDeallocatingInterfaceNotice"
rfkill unblock all &> $FLUXIONOutputDevice )"$CClr"
if interface_is_wireless $oldIdentifier; then
# Attempt deactivating monitor mode on the interface. # Attempt deactivating monitor mode on the interface.
if interface_set_mode $oldIdentifier managed; then if ! interface_set_mode $oldIdentifier managed; then
return 3 return 3
fi fi
fi fi
@ -727,7 +725,12 @@ fluxion_allocate_interface() { # Reserve interfaces
if ! interface_is_real $identifier; then return 2; fi if ! interface_is_real $identifier; then return 2; fi
echo -e "$FLUXIONVLine $FLUXIONAllocatingInterfaceNotice"
local interfaceIdentifier=$identifier
echo -e "$CWht[$CSGrn+$CWht] "$(
io_dynamic_output "$FLUXIONAllocatingInterfaceNotice"
)"$CClr"
if interface_is_wireless $identifier; then if interface_is_wireless $identifier; then
# Unblock wireless interfaces to make them available. # Unblock wireless interfaces to make them available.

View File

@ -3,9 +3,11 @@
# native: English # native: English
FLUXIONInterfaceQuery="Select a wireless interface" FLUXIONInterfaceQuery="Select a wireless interface"
FLUXIONAllocatingInterfaceNotice="Starting interface reservation..." FLUXIONAllocatingInterfaceNotice="Allocating reserved interface $CGrn\"\$interfaceIdentifier\"."
FLUXIONReidentifyingInterface="Renaming interface..." FLUXIONDeallocatingInterfaceNotice="Deallocating reserved interface $CGrn\"\$interfaceIdentifier\"."
FLUXIONUnblockingWINotice="Unblocking all wireless interfaces..." FLUXIONReidentifyingInterface="Renaming interface."
FLUXIONUnblockingWINotice="Unblocking all wireless interfaces."
#FLUXIONFindingExtraWINotice="Looking for extraneous wireless interfaces..." #FLUXIONFindingExtraWINotice="Looking for extraneous wireless interfaces..."
FLUXIONRemovingExtraWINotice="Removing extraneous wireless interfaces..." FLUXIONRemovingExtraWINotice="Removing extraneous wireless interfaces..."
FLUXIONFindingWINotice="Looking for available wireless interfaces..." FLUXIONFindingWINotice="Looking for available wireless interfaces..."