mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
12 lines
239 B
Bash
Executable File
12 lines
239 B
Bash
Executable File
#! /bin/sh
|
|
|
|
ssh_session_pattern='sshd: \S.*@pts/[0-9]+'
|
|
|
|
IFS="$IFS@"
|
|
pgrep -a -f "$ssh_session_pattern" | while read pid daemon user pty; do
|
|
echo "Found ${daemon%:} session $pid on $pty; sending SIGTERM"
|
|
kill "$pid" || true
|
|
done
|
|
|
|
exit 0
|