From fcea23dbcd1bda0b60f09f327d49b6d31f54d961 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 14 Oct 2020 02:47:52 -0600 Subject: [PATCH] openrc: use ifquery -r to determine which interfaces to stop --- dist/openrc/networking.initd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/openrc/networking.initd b/dist/openrc/networking.initd index 346f269..52ab5f4 100644 --- a/dist/openrc/networking.initd +++ b/dist/openrc/networking.initd @@ -30,7 +30,7 @@ find_running_ifaces() { if [ -n "$single_iface" ]; then echo $single_iface else - awk -F= '{print $2}' $ifstate + ifquery -r -i "$cfgfile" -S "$ifstate" fi } @@ -41,8 +41,8 @@ start() { for iface in $(find_ifaces); do local r=0 ebegin "$iface" - if ! ifup -i "$cfgfile" $iface >/dev/null; then - ifdown -i "$cfgfile" $iface >/dev/null 2>&1 + if ! ifup -i "$cfgfile" -S "$ifstate" $iface >/dev/null; then + ifdown -f -i "$cfgfile" -S "$ifstate" $iface >/dev/null 2>&1 r=1 fi # atleast one interface needs to be started for action