mirror of
https://gitlab.com/shorewall/code.git
synced 2025-03-07 11:01:19 +01:00
Re-code interface_is_usable()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
1f621002b7
commit
3d575a45bd
@ -176,8 +176,24 @@ interface_is_up() {
|
|||||||
#
|
#
|
||||||
interface_is_usable() # $1 = interface
|
interface_is_usable() # $1 = interface
|
||||||
{
|
{
|
||||||
[ "$1" = lo -o $COMMAND = enable ] && return 0
|
local status;
|
||||||
interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ] && run_isusable_exit $1
|
status=0
|
||||||
|
|
||||||
|
if [ "$1" != lo ]; then
|
||||||
|
if [ $g_family -eq 4 ]; then
|
||||||
|
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 -a "$COMMAND" != enable ]; then
|
||||||
|
run_isusable_exit $1
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: -a "$COMMAND" != enable ]; then
|
||||||
|
run_isusable_exit $1
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
return $status
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user