[OpenWrt-Devel] [PATCH] ubox: Run init script through shellcheck

Jo-Philipp Wich jo at mein.io
Wed Jul 24 13:52:15 EDT 2019


I suppose this has no been runtime tested since `$(${PIDCOUNT} + 1)`
will attempt to execute `${PIDCOUNT}` as command in a subshell with '+'
and '1' passed as arguments to it:

  root at OpenWrt:~# PIDCOUNT=1; PIDCOUNT="$(${PIDCOUNT} + 1)"; echo
  -ash: 1: not found

I think the proper fix should be something like:


or even:

  local pid_file="/var/run/logread.$((++PIDCOUNT)).pid"

... without an explicit separate assignment.

~ Jo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20190724/a0e20bb8/attachment.sig>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list