get rid of the who -m ssh session test

I dont like executing a binary in a fast startup script. Lets see
if there are a lot of sessions in the wild that dont use the SSH_TTY
env var
This commit is contained in:
Kovid Goyal
2022-03-06 15:47:08 +05:30
parent 75d5e386d3
commit 795953a341
2 changed files with 5 additions and 11 deletions

View File

@@ -235,9 +235,6 @@ _ksi_deferred_init() {
builtin local is_ssh_session="n"
if [[ -n "$SSH_TTY$SSH2_TTY" ]]; then
is_ssh_session="y";
elif [[ -n "$(builtin command -v who)" ]]; then
# OpenSSH's sshd creates entries in utmp for every login so use those
[[ "$(builtin command who -m 2> /dev/null)" =~ "\([a-fA-F.:0-9]+\)$" ]] && is_ssh_session="y";
fi
if [[ "$is_ssh_session" == "y" ]]; then