0001-bridge-stp.in-support-different-versions-of-pidof-13.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 181c453fc1a00573e19f14960dcc54ad84beea7c Mon Sep 17 00:00:00 2001
  2. From: colin-foster-in-advantage <colin.foster@in-advantage.com>
  3. Date: Tue, 12 Jul 2022 23:01:09 -0700
  4. Subject: [PATCH] bridge-stp.in: support different versions of pidof (#137)
  5. * bridge-stp.in: support different versions of pidof
  6. Busybox uses a version of pdiof that doesn't support the -c option. As
  7. such, this renders mstpd non-functional on any Busybox system.
  8. Just use the standard form of pidof to detect any running instances of mstpd.
  9. Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
  10. ---
  11. bridge-stp.in | 6 +++---
  12. 1 file changed, 3 insertions(+), 3 deletions(-)
  13. diff --git a/bridge-stp.in b/bridge-stp.in
  14. index 47cbe79..3807873 100755
  15. --- a/bridge-stp.in
  16. +++ b/bridge-stp.in
  17. @@ -139,7 +139,7 @@ case "$action" in
  18. fi
  19. # Start mstpd if necessary.
  20. - if ! pidof -c -s mstpd >/dev/null; then
  21. + if ! pidof -s mstpd >/dev/null; then
  22. if [ "$MANAGE_MSTPD" != 'y' ]; then
  23. errmsg 'mstpd is not running'
  24. exit 3
  25. @@ -212,12 +212,12 @@ case "$action" in
  26. done
  27. # Kill mstpd, since no bridges are currently using it.
  28. - kill $(pidof -c mstpd)
  29. + kill $(pidof mstpd)
  30. ;;
  31. restart|restart_config)
  32. if [ "$action" = 'restart' ]; then
  33. # Kill mstpd.
  34. - pids="$(pidof -c mstpd)" ; Err=$?
  35. + pids="$(pidof mstpd)" ; Err=$?
  36. if [ $Err -eq 0 ]; then
  37. echo 'Stopping mstpd ...'
  38. kill $pids
  39. --
  40. 2.25.1