File: list-hooks.sh

package info (click to toggle)
hibernate 1.99-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 780 kB
  • ctags: 61
  • sloc: sh: 2,194; makefile: 58
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