File: list-hooks.sh

package info (click to toggle)
hibernate 2.0%2B15%2Bg88d54a8-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 740 kB
  • ctags: 114
  • sloc: sh: 1,223; makefile: 17
file content (12 lines) | stat: -rw-r--r-- 443 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# List all hooks in the given scriptlets.d directory, in order.
# For development use only.

DIR=$1
[ -z "$DIR" ] && DIR=.

grep AddSuspendHook $DIR/* | sed -e 's/^[^\/]*\/\([^\/]\+\):.*AddSuspendHook[ \t]\+\([0-9]\+\)[ \t]\+\([^#]*\).*/Suspend: \2 \3 [\1]/;t n;d;:n' |sort -n

grep AddResumeHook $DIR/* | sed -e 's/^[^\/]*\/\([^\/]\+\):.*AddResumeHook[ \t]\+\([0-9]\+\)[ \t]\+\([^#]*\).*/ Resume: \2 \3 [\1]/;t n;d;:n' | sort -nr