network-manager: call the online hook for connected devices

Look for "connection-uuid" instead of "managed" to determine the devices
that are actually activated with a connection and call the online hook.

This fixes the anaconda-net root mount, which utilizes the online hook.
master
Lubomir Rintel 2018-11-27 15:30:48 +01:00 committed by Harald Hoyer
parent 76522d58c3
commit 79a17b0112
1 changed files with 2 additions and 1 deletions

View File

@ -9,8 +9,9 @@ fi
for _i in /sys/class/net/*/
do
state=/run/NetworkManager/devices/$(cat $_i/ifindex)
grep -q managed=true $state 2>/dev/null || continue
grep -q connection-uuid= $state 2>/dev/null || continue
ifname=$(basename $_i)
sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts
source_hook initqueue/online $ifname
/sbin/netroot $ifname
done