flake: Restructure home/

This commit is contained in:
Alexander Kobjolke 2024-02-04 07:54:33 +01:00
parent 07268b2730
commit 9389d2661a
5 changed files with 3 additions and 4 deletions

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
mysession=$(cat /proc/self/sessionid)
count=0
while read pid _; do
session=$(cat /proc/$pid/sessionid)
if [ "$mysession" != "$session" ]; then
if kill $pid; then
echo 2>&1 "stale mosh session $pid killed"
count=$((count + 1))
fi
fi
done <<<$(ps -C mosh-server -o pid=,etimes= | sort -k 2 -r)
if [[ $count -eq 0 ]]; then
echo 2>&1 "No stale mosh session found"
fi