File: testprocsys

package info (click to toggle)
whereami 0.3.37
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: sh: 1,094; perl: 524; makefile: 24
file content (27 lines) | stat: -rwxr-xr-x 474 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash 
#
# by Matthew Grant <grantma@anathoth.gen.nz>, (c) 2004
# licensed for use under GPL version 2
#
# Tests whether hotplug is set up and running or not.

# Turn on debugging
[ "$DEBUGWHEREAMI" = "1" ] && set -o xtrace

case $1 in
	*,*)
		FILE=${1/,*}
		STRING=${1/*,}
		;;
	*)
		[ "$DEBUGWHEREAMI" != "" ] \
	&& echo "$0: failing miserably - args not understood"
		exit 255
		;;
esac

[ -f "$FILE" ] \
	&& cat "$FILE" | grep -E -q "$STRING" \
	&& exit 0

exit 1