# called by dracut
check() {
- local _program
-
require_binaries sed grep || return 1
# do not add this module by default
fi
if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
+ # shellcheck disable=SC2174
mkdir -m 0755 -p /run/NetworkManager/conf.d
(
echo '[logging]'
nm_generate_connections() {
rm -f /run/NetworkManager/system-connections/*
+ # shellcheck disable=SC2046
/usr/libexec/nm-initrd-generator -- $(getcmdline)
if getargbool 0 rd.neednet; then
/etc/NetworkManager/system-connections/* \
/etc/sysconfig/network-scripts/ifcfg-*; do
[ -f "$i" ] || continue
- echo '[ -f /tmp/nm.done ]' > $hookdir/initqueue/finished/nm.sh
+ echo '[ -f /tmp/nm.done ]' > "$hookdir"/initqueue/finished/nm.sh
break
done
fi
fi
for _i in /sys/class/net/*; do
- state=/run/NetworkManager/devices/$(cat $_i/ifindex)
- grep -q connection-uuid= $state 2> /dev/null || continue
+ state=/run/NetworkManager/devices/$(cat "$_i"/ifindex)
+ grep -q connection-uuid= "$state" 2> /dev/null || continue
ifname=${_i##*/}
- sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p' < $state > /tmp/dhclient.$ifname.dhcpopts
- source_hook initqueue/online $ifname
- /sbin/netroot $ifname
+ sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p' < "$state" > /tmp/dhclient."$ifname".dhcpopts
+ source_hook initqueue/online "$ifname"
+ /sbin/netroot "$ifname"
done
-> /tmp/nm.done
+: > /tmp/nm.done