openrc: use ifquery -r to determine which interfaces to stop
This commit is contained in:
parent
311ad74792
commit
fcea23dbcd
1 changed files with 3 additions and 3 deletions
6
dist/openrc/networking.initd
vendored
6
dist/openrc/networking.initd
vendored
|
@ -30,7 +30,7 @@ find_running_ifaces() {
|
||||||
if [ -n "$single_iface" ]; then
|
if [ -n "$single_iface" ]; then
|
||||||
echo $single_iface
|
echo $single_iface
|
||||||
else
|
else
|
||||||
awk -F= '{print $2}' $ifstate
|
ifquery -r -i "$cfgfile" -S "$ifstate"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ start() {
|
||||||
for iface in $(find_ifaces); do
|
for iface in $(find_ifaces); do
|
||||||
local r=0
|
local r=0
|
||||||
ebegin "$iface"
|
ebegin "$iface"
|
||||||
if ! ifup -i "$cfgfile" $iface >/dev/null; then
|
if ! ifup -i "$cfgfile" -S "$ifstate" $iface >/dev/null; then
|
||||||
ifdown -i "$cfgfile" $iface >/dev/null 2>&1
|
ifdown -f -i "$cfgfile" -S "$ifstate" $iface >/dev/null 2>&1
|
||||||
r=1
|
r=1
|
||||||
fi
|
fi
|
||||||
# atleast one interface needs to be started for action
|
# atleast one interface needs to be started for action
|
||||||
|
|
Loading…
Reference in a new issue