File: list-hooks.sh

package info (click to toggle)
hibernate 1.07-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 316 kB
  • ctags: 52
  • sloc: sh: 1,014; makefile: 33
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