Skip to content

Instantly share code, notes, and snippets.

@facundobianco
Created May 13, 2015 13:42
Show Gist options
  • Save facundobianco/b84eab31df06bcd8e2ba to your computer and use it in GitHub Desktop.
Save facundobianco/b84eab31df06bcd8e2ba to your computer and use it in GitHub Desktop.
Action script to kill process before suspend.
#!/bin/sh
#
# /etc/pm/sleep.d/30_process
# Action script to kill process before suspend.
PROCESS="ssh getmail"
PATH=/usr/bin
case ${1} in
suspend|hibernate)
for PROC in ${PROCESS}
do
pkill -HUP -f ^${PROC}
done
;;
resume|thaw)
# None.
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment