Check that bond has slaves before commit.
This commit is contained in:
parent
beb23adb23
commit
6a0b8aea5e
@ -46,6 +46,17 @@ is_bond()
|
|||||||
[ "$(read_iface_option "$ifacedir" TYPE)" = bond ]
|
[ "$(read_iface_option "$ifacedir" TYPE)" = bond ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_bond()
|
||||||
|
{
|
||||||
|
local iface="$1"; shift
|
||||||
|
|
||||||
|
if [ -n "$(read_iface_slaves "$cachedir/$iface")" ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
real_iface()
|
real_iface()
|
||||||
{
|
{
|
||||||
local ifacedir="$1"; shift
|
local ifacedir="$1"; shift
|
||||||
@ -231,6 +242,12 @@ commit_cache()
|
|||||||
local old_ipv6configuration="$(read_configuration "/etc/net/ifaces/$ifname" 6)"
|
local old_ipv6configuration="$(read_configuration "/etc/net/ifaces/$ifname" 6)"
|
||||||
local new_ipv6configuration="$(read_configuration "$iface" 6)"
|
local new_ipv6configuration="$(read_configuration "$iface" 6)"
|
||||||
|
|
||||||
|
# check bond settings
|
||||||
|
if is_bond "$ifname" && ! check_bond "$ifname"; then
|
||||||
|
write_error "`_ "Bond inteface $ifname confifiguration is invalid"`"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
#update configs
|
#update configs
|
||||||
rm -rf -- "/etc/net/ifaces/$ifname"
|
rm -rf -- "/etc/net/ifaces/$ifname"
|
||||||
if [ -e "$cachedir/$ifname/REMOVED" ]; then
|
if [ -e "$cachedir/$ifname/REMOVED" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user