File: aoe-revalidate.in

package info (click to toggle)
aoetools 26-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 224 kB
  • ctags: 140
  • sloc: ansic: 773; sh: 477; makefile: 64
file content (26 lines) | stat: -rw-r--r-- 546 bytes parent folder | download
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
#! /bin/sh
# aoe-revalidate - ask aoe driver to query AoE target
# Copyright 2008, Coraid, Inc., and licensed under GPL v.2.

zero=`basename $0`
f=@devdir@/revalidate

if test -z "$*"; then
	echo 1>&2 Usage: $zero 'e{major}.{minor}'
	exit 1
fi
if ! test -w $f; then
	echo 1>&2 $zero: $f does not exist or is not writeable
	exit 1
fi
if ! test -c $f; then
	exec 1>&2
	echo "$zero: $f is not a character device file"
	echo "$zero: use udev or aoe-mkdevs to create it"
	exit 1
fi
echo "$*" > $f || {
	echo "$zero: revalidate failed" 1>&2
	exit 1
}