#!/usr/bin/env bash
set -uo pipefail
# The shared helper finds this hook only when AVE is installed. Never start
# an inactive AVE service merely because the machine is resuming.
[[ -S /run/t2remote.sock ]] || exit 0
case "${1:-}" in
	pre) exec timeout --kill-after=2 15 t2remote pre-suspend ;;
	post) exec timeout --kill-after=2 120 t2remote post-resume ;;
	*) exit 2 ;;
esac
