]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: Replace `strings` to `tr` for frrinit.sh 10886/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 24 Mar 2022 13:26:26 +0000 (15:26 +0200)
committermergify-bot <noreply@mergify.com>
Fri, 25 Mar 2022 14:10:37 +0000 (14:10 +0000)
dc3bae68a2422ead82a12fa8480417fd4e351cdd added strings command, which is wrong.

It requires additional package to be installed on the system (binutils).

Let's just get use `tr`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 3989029bc06733955138ba914529bbdb743d2066)

tools/frrinit.sh.in

index e41f2706e0ae1673eb129a616f73399016a55afa..df5f0853da0ee3887654a4edba027022263ecb71 100644 (file)
@@ -77,7 +77,7 @@ reload)
        # systemd doesn't set WATCHDOG_USEC for reload commands.
        watchfrr_pidfile="$V_PATH/watchfrr.pid"
        watchfrr_pid="`cat \"$watchfrr_pidfile\"`"
-       watchfrr_cmdline="`strings /proc/$watchfrr_pid/cmdline`"
+       watchfrr_cmdline="`tr '\0' '\n' < /proc/$watchfrr_pid/cmdline`"
        if [ -d "/proc/$watchfrr_pid" ]; then
                wdt="`tr '\0' '\n' < /proc/$watchfrr_pid/environ | grep '^WATCHDOG_USEC='`"
                wdt="${wdt#WATCHDOG_USEC=}"