openrc: use ifquery -r to determine which interfaces to stop

This commit is contained in:
Ariadne Conill 2020-10-14 02:47:52 -06:00
parent 311ad74792
commit fcea23dbcd

View file

@ -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