]> git.ipfire.org Git - thirdparty/asterisk.git/commit
contrib: rc.archlinux.asterisk uses invalid redirect.
authorSean Bright <sean@seanbright.com>
Thu, 2 Mar 2023 14:59:51 +0000 (09:59 -0500)
committerAsterisk Development Team <asteriskteam@digium.com>
Mon, 8 May 2023 17:55:16 +0000 (17:55 +0000)
commit2268895b88381b1c0cc761b90324555f3957d363
tree23c321d58e20c7758da34f3c779c4bb3782d91a2
parent86c9ee22f80a7bba3f6ad1f10a8076b4e7617703
contrib: rc.archlinux.asterisk uses invalid redirect.

`rc.archlinux.asterisk`, which explicitly requests bash in its
shebang, uses the following command syntax:

  ${DAEMON} -rx "core stop now" > /dev/null 2&>1

The intent of which is to execute:

  ${DAEMON} -rx "core stop now"

While sending both stdout and stderr to `/dev/null`. Unfortunately,
because the `&` is in the wrong place, bash is interpreting the `2` as
just an additional argument to the `$DAEMON` command and not as a file
descriptor and proceeds to use the bashism `&>` to send stderr and
stdout to a file named `1`.

So we clean it up and just use bash's shortcut syntax.

Issue raised and a fix suggested (but not used) by peutch on GitHub¹.

ASTERISK-30449 #close

1. https://github.com/asterisk/asterisk/pull/31

Change-Id: Ie279bf4efb4d95cbf507313483d316e977303d19
(cherry picked from commit 5283d444d9ea4ae85c973b3c4994002a3aebc410)
contrib/init.d/rc.archlinux.asterisk