mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-14 02:36:59 -07:00
* usr/lib/byobu/users, usr/share/byobu/status/statusrc,
usr/share/man/man1/byobu.1: LP: #900663 - add support for a USERS_DISTINCT=1 status configuration setting to count the number of distinct users, rather than open ssh sessions
This commit is contained in:
parent
7fb5da7e57
commit
20f7f3d5db
4 changed files with 21 additions and 4 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -28,6 +28,10 @@ byobu (4.53) unreleased; urgency=low
|
|||
- use ~/.local/share/byobu as BYOBU_CONFIG_DIR, if it happens to exist
|
||||
* usr/lib/byobu/include/dirs: LP: #899271
|
||||
- allow explicit BYOBU_CONFIG_DIR selection in ~/.byoburc
|
||||
* usr/lib/byobu/users, usr/share/byobu/status/statusrc,
|
||||
usr/share/man/man1/byobu.1: LP: #900663
|
||||
- add support for a USERS_DISTINCT=1 status configuration setting
|
||||
to count the number of distinct users, rather than open ssh sessions
|
||||
|
||||
[ Andrew McCarthy ]
|
||||
* usr/bin/byobu-status: LP: #898801
|
||||
|
|
|
@ -27,9 +27,13 @@ __users_detail() {
|
|||
|
||||
__users() {
|
||||
local count
|
||||
# Note: we'd like to use pgrep -c, however, this isn't available in
|
||||
# busybox and some distro's pgrep (and it doesn't exit non-zero).
|
||||
count=`pgrep -f "sshd:.*@" | wc -l` || return
|
||||
if [ "$USERS_DISTINCT" = "1" ]; then
|
||||
count=$(pgrep -fl 'sshd:.*@' | cut -f3 -d\ | cut -f1 -d@ | sort -u | wc -l)
|
||||
else
|
||||
# Note: we'd like to use pgrep -c, however, this isn't available in
|
||||
# busybox and some distro's pgrep (and it doesn't exit non-zero).
|
||||
count=$(pgrep -f "sshd:.*@" | wc -l) || return
|
||||
fi
|
||||
if [ $count -gt 0 ]; then
|
||||
color b w r; printf "%d" "$count"; color -; color w r; printf "#"; color --
|
||||
fi
|
||||
|
|
|
@ -58,3 +58,12 @@
|
|||
#SERVICES="eucalyptus-nc|NC eucalyptus-cloud|CLC eucalyptus-walrus eucalyptus-cc|CC eucalyptus-sc|SC"
|
||||
|
||||
#FAN=$(find /sys -type f -name fan1_input | head -n1)
|
||||
|
||||
# You can set this to 1 to report your external/public ip address
|
||||
# Default: 0
|
||||
#IP_EXTERNAL=0
|
||||
|
||||
# The users notification normally counts ssh sessions; set this configuration to '1'
|
||||
# to instead count number of distinct users logged onto the system
|
||||
# Default: 0
|
||||
#USERS_DISTINCT=0
|
||||
|
|
|
@ -91,7 +91,7 @@ Note that BYOBU_CONFIG_DIR=\fI$XDG_CONFIG_HOME/byobu\fP if defined, and \fI$HOME
|
|||
|
||||
\fBuptime\fP \- the total system uptime since last boot; displayed in the lower bar toward the right in blue text on a grey background
|
||||
|
||||
\fBusers\fP \- the number of remote users logged into the system via sshd, empty if 0 users; displayed in the lower bar toward the right in red text on a grey background with a trailing '#' sign
|
||||
\fBusers\fP \- the number of remote users logged into the system via sshd, empty if 0 users; displayed in the lower bar toward the right in red text on a grey background with a trailing '#' sign; set USERS_DISTINCT=1 to instead count the number of distinct users logged into the system (rather than open ssh sessions)
|
||||
|
||||
\fBwhoami\fP \- the name of the user who owns the screen session; displayed in the upper bar toward the far right in bold black text on a grey background
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue