12345678910111213141516171819202122232425262728 |
- #! /bin/sh
- # aoe-flush - ask aoe driver to forget about devices
- # Copyright 2007, Coraid, Inc., and licensed under GPL v.2.
- zero="`basename $0`"
- f="@devdir@/flush"
- spec=""
- 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
- if test "$1" = "-a"; then
- spec=all
- fi
- echo $spec > "$f" || {
- echo 1>&2 "$zero: flush failed"
- exit 1
- }
|