From 768f08712db39d08f2df667d7273aa753ca18b16 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 27 May 2019 03:18:32 +0800 Subject: [PATCH] * usr/lib/byobu/users: - Handle stderr for ps, e.g. unsupported options - Fix trailing '#' sign --- debian/changelog | 3 +++ usr/lib/byobu/users | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e13afd48..8a41f1ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,6 +50,9 @@ byobu (5.128) unreleased; urgency=medium - Fix screen session regex * usr/lib/byobu/updates_available: - Add support for opkg (OpenWrt) + * usr/lib/byobu/users: + - Handle stderr for ps, e.g. unsupported options + - Fix trailing '#' sign * usr/lib/byobu/whoami: - Use id if the whoami command is not available - Read from /etc/passwd if the getent command is not available diff --git a/usr/lib/byobu/users b/usr/lib/byobu/users index 1f16f066..0d8dd21f 100755 --- a/usr/lib/byobu/users +++ b/usr/lib/byobu/users @@ -22,7 +22,7 @@ # along with this program. If not, see . __users_detail() { - ps -ef | grep "sshd:.*@" | grep -v grep + ps -ef 2>/dev/null | grep "sshd:.*@" | grep -v grep } __users() { @@ -35,7 +35,7 @@ __users() { count=$(pgrep -f "^sshd:.*@|^/usr/sbin/sshd -i" | wc -l) || return fi if [ $count -gt 0 ]; then - color b w r; printf "%d" "$count"; color -; color w r; printf "#"; color -- + color b w r; printf "%d" "$count"; color -; color w r; printf "##"; color -- else rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/users"* fi