From cedde585f67f885d67db1e3e2b2dce9e145f64de Mon Sep 17 00:00:00 2001 From: PJGuyTen <81108571+PJGuyTen@users.noreply.github.com> Date: Thu, 14 Jul 2022 09:14:39 -0400 Subject: [PATCH] Verifying user and group in lnms script (#278) --- rootfs/usr/bin/lnms | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rootfs/usr/bin/lnms b/rootfs/usr/bin/lnms index 99695c1..3176e66 100755 --- a/rootfs/usr/bin/lnms +++ b/rootfs/usr/bin/lnms @@ -1,3 +1,7 @@ #!/usr/bin/env sh -yasu librenms:librenms php -f /opt/librenms/lnms "$@" +if [ "$(id -u -n)" = "librenms" -a "$(id -g -n)" = "librenms" ]; then + php -f /opt/librenms/lnms "$@" +else + yasu librenms:librenms php -f /opt/librenms/lnms "$@" +fi