Removed obsolete interface-selection subroutine.

This commit is contained in:
Matias Barcenas 2018-01-17 23:23:22 -06:00
parent 6a5efbdbdd
commit 9e719e22ea
1 changed files with 1 additions and 51 deletions

View File

@ -179,54 +179,4 @@ function interface_reidentify() {
return $? return $?
} }
function interface_prompt() { # FLUXSCRIPT END
if [ -z "$1" -o -z "$2" ]; then return 1; fi
local __interface_prompt__ifAvailable=("${!2}")
local __interface_prompt__ifAvailableInfo=()
local __interface_prompt__ifAvailableColor=()
local __interface_prompt__ifAvailableState=()
local __interface_prompt__ifCandidate
for __interface_prompt__ifCandidate in "${__interface_prompt__ifAvailable[@]}"; do
interface_chipset "$__interface_prompt__ifCandidate"
__interface_prompt__ifAvailableInfo+=("$InterfaceChipset")
interface_state "$__interface_prompt__ifCandidate"
if [ "$InterfaceState" = "up" ]; then
__interface_prompt__ifAvailableColor+=("$CPrp")
__interface_prompt__ifAvailableState+=("[-]")
else
__interface_prompt__ifAvailableColor+=("$CClr")
__interface_prompt__ifAvailableState+=("[+]")
fi
done
# The following conditional is required since io_query_format_fields
# only considers the the size of the first parameter, available color.
if [ "$6" ]; then # Add alternative choices
__interface_prompt__ifAvailable+=("${!3}")
__interface_prompt__ifAvailableInfo+=("${!4}")
__interface_prompt__ifAvailableState+=("${!5}")
__interface_prompt__ifAvailableColor+=("${!6}")
fi
# If only one interface exists and it's available, choose it.
if [ "${#__interface_prompt__ifAvailable[@]}" -eq 1 -a "${__interface_prompt__ifAvailableState[0]}" = "[+]" ]; then
InterfacePromptWISelected="${__interface_prompt__ifAvailable[0]}"
InterfacePromptWISelectedState="[+]" # It passed the condition, it must be +
InterfacePromptWISelectedInfo="${__interface_prompt__ifAvailableInfo[0]}"
else
format_apply_autosize "$CRed[$CSYel%1d$CClr$CRed]%b %-8b %3s$CClr %-*.*s\n"
io_query_format_fields "$1" "$FormatApplyAutosize" \
__interface_prompt__ifAvailableColor[@] __interface_prompt__ifAvailable[@] \
__interface_prompt__ifAvailableState[@] __interface_prompt__ifAvailableInfo[@]
echo
InterfacePromptIfSelected="${IOQueryFormatFields[1]}"
InterfacePromptIfSelectedState="${IOQueryFormatFields[2]}"
InterfacePromptWISelectedInfo="${IOQueryFormatFields[3]}"
fi
}