summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/usr/sbin/penv7
1 files changed, 7 insertions, 0 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/usr/sbin/penv b/remote/rootfs/rootfs-stage32/data/usr/sbin/penv
new file mode 100755
index 00000000..ca5a23ac
--- /dev/null
+++ b/remote/rootfs/rootfs-stage32/data/usr/sbin/penv
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "x$UID" != "x0" ] && echo "You need to be root." && exit 1
+[ "$#" -ne "1" ] && echo "Usage: $0 PID" && exit 1
+[ ! -d "/proc/$1/environ" ] && echo "No such process: $1" && exit 1
+sed 's/\x0/\n/g' "/proc/$1/environ" | grep -E --color=auto '^[^=]*'
+