~mil/sxmo-utils

b4f5812d6d0338e642d0b71b00bcce9d9c97b62e — Zach DeCook 9 days ago ac20c45
check mutexes: Don't resolve names with netstat

(can save 10 seconds of execution)

Also, limit to TCP sockets, because it's SSH.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
1 files changed, 2 insertions(+), 2 deletions(-)

M configs/default_hooks/sxmo_hook_check_state_mutexes.sh
M configs/default_hooks/sxmo_hook_check_state_mutexes.sh => configs/default_hooks/sxmo_hook_check_state_mutexes.sh +2 -2
@@ 60,7 60,7 @@ else
fi

# active_ssh
if netstat | grep ESTABLISHED | cut -d':' -f2 | grep -q ssh; then
if netstat -tn | grep ESTABLISHED | cut -d':' -f2 | grep -q '^22 '; then
	lock_suspend_mutex "SSH is connected"
else
	free_suspend_mutex "SSH is connected"


@@ 74,7 74,7 @@ else
fi

# mpris compatible media player
if command -v playerctl; then
if command -v playerctl > /dev/null; then
	if test "$(playerctl status)" = "Playing"; then
		lock_suspend_mutex "MPRIS client is playing"
	else