diff --git a/lib/lib.sh b/lib/lib.sh
index d01dd23..02357d9 100644
--- a/lib/lib.sh
+++ b/lib/lib.sh
@@ -399,6 +399,13 @@ register_networkd_reloader() {
         mkdir -p "$lockdir"
         trap 'debug "Called trap" ; maybe_reload_networkd' EXIT
         echo $$ > "${lockdir}/${iface}"
+	# Shellcheck would warn about the following line, with "This
+	# $? refers to echo/printf, not a previous command. Assign to
+	# variable to avoid it being overwritten."  We actually want
+	# echo's exit code, since it will be nonzero if the redirect
+	# fails (that is, if somebody else deleted $lockdir before we
+	# got to put a file there)
+	# shellcheck disable=SC2320
         registered=$?
     done
 }
