mirror of
https://github.com/Horhik/dotfiles.git
synced 2024-11-08 01:43:13 +00:00
11 lines
248 B
Bash
11 lines
248 B
Bash
#!/bin/sh
|
|
|
|
sessions="$(lsof -Pi | grep ":22")"
|
|
|
|
if [ -n "$sessions" ]; then
|
|
count=$(echo "$sessions" | wc -l)
|
|
echo "# ($count): $(echo "$sessions" | cut -d ">" -f 2 | cut -d " " -f 1 | cut -d ":" -f 1 | tail -n 1)"
|
|
else
|
|
echo "# (0)"
|
|
fi
|