]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(network-manager): shellcheck for modules.d/35network-manager
authorHarald Hoyer <harald@redhat.com>
Fri, 26 Mar 2021 09:29:14 +0000 (10:29 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 26 Mar 2021 14:02:59 +0000 (15:02 +0100)
modules.d/35network-manager/.shchkdir [new file with mode: 0644]
modules.d/35network-manager/module-setup.sh
modules.d/35network-manager/nm-config.sh
modules.d/35network-manager/nm-lib.sh
modules.d/35network-manager/nm-run.sh

diff --git a/modules.d/35network-manager/.shchkdir b/modules.d/35network-manager/.shchkdir
new file mode 100644 (file)
index 0000000..e69de29
index 03d9c9b54d1ad16015851e13276e96d5a9edb2fd..204e5cd80cb95ea35446aeff93401fc60f117e7f 100755 (executable)
@@ -2,8 +2,6 @@
 
 # called by dracut
 check() {
-    local _program
-
     require_binaries sed grep || return 1
 
     # do not add this module by default
index 63f40ed2cca09c210824ef040f196300a1fb46c1..fb8ddcc52d16b4d353d1c3d0d411248070607cd7 100755 (executable)
@@ -7,6 +7,7 @@ if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
 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]'
index fbbb1d0e023545a14a8e1b978629cc5bd09edb2a..48e45799c2be1de8faffcccac350a05c35652255 100644 (file)
@@ -4,6 +4,7 @@ type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh
 
 nm_generate_connections() {
     rm -f /run/NetworkManager/system-connections/*
+    # shellcheck disable=SC2046
     /usr/libexec/nm-initrd-generator -- $(getcmdline)
 
     if getargbool 0 rd.neednet; then
@@ -12,7 +13,7 @@ nm_generate_connections() {
             /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
index 46265a2596dcf00e87ac9310153d16e9bb3ec51b..d48028df4a50e58a29b5a7689294f0be4b26a370 100755 (executable)
@@ -21,12 +21,12 @@ if [ -s /run/NetworkManager/initrd/hostname ]; then
 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