Skip to content

Instantly share code, notes, and snippets.

@nojkepop
Forked from bruienne/logoutwatcher.sh
Created July 26, 2023 21:58
Show Gist options
  • Save nojkepop/acda669e18e7989ac6463f29b8433036 to your computer and use it in GitHub Desktop.
Save nojkepop/acda669e18e7989ac6463f29b8433036 to your computer and use it in GitHub Desktop.
logout watcher
onLogout() {
# Insert whatever script you need to run at logout
exit
}
echo "INFO - Watching ${HOME}" >> /var/log/org.my.log
trap 'onLogout' SIGINT SIGHUP SIGTERM
while true; do
sleep 86400 &
wait $!
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment