मैनपेज से pm-action(8)
:
/etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d
Programs in these directories (called hooks) are combined
and executed in C sort order before suspend and hibernate
with as argument ´suspend´ or ´hibernate´. Afterwards they
are called in reverse order with argument ´resume´ and
´thaw´ respectively. If both directories contain a similar
named file, the one in /etc/pm/sleep.d will get preference.
It is possible to disable a hook in the distribution
directory by putting a non-executable file in
/etc/pm/sleep.d, or by adding it to the HOOK_BLACKLIST
configuration variable.
इस प्रकार आप केवल इस तरह से एक शेल-स्क्रिप्ट डाल सकते हैं:
#!/bin/bash
case "$1" in
suspend|hibernate)
actions to
take
on suspend
or hibernate
;;
resume|thaw)
other actions
to trigger
on resume
;;
esac
जैसे में 99-myhooks.sh
और यह निष्पादन योग्य बनाते हैं।
BTW, आप Enter~.EnterSSH सत्र में प्रवेश करके बासी SSH- कनेक्शन को मार सकते हैं ।