Từ trang web 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.
Vì vậy, bạn có thể chỉ cần đặt một kịch bản shell như thế này:
#!/bin/bash
case "$1" in
suspend|hibernate)
actions to
take
on suspend
or hibernate
;;
resume|thaw)
other actions
to trigger
on resume
;;
esac
vào ví dụ 99-myhooks.sh
và làm cho nó thực thi được.
BTW, bạn có thể tiêu diệt các kết nối SSH cũ bằng cách nhập vào Enter~.Enterphiên SSH.