aoe-revalidate.in 546 B

1234567891011121314151617181920212223242526
  1. #! /bin/sh
  2. # aoe-revalidate - ask aoe driver to query AoE target
  3. # Copyright 2008, Coraid, Inc., and licensed under GPL v.2.
  4. zero=`basename $0`
  5. f=@devdir@/revalidate
  6. if test -z "$*"; then
  7. echo 1>&2 Usage: $zero 'e{major}.{minor}'
  8. exit 1
  9. fi
  10. if ! test -w $f; then
  11. echo 1>&2 $zero: $f does not exist or is not writeable
  12. exit 1
  13. fi
  14. if ! test -c $f; then
  15. exec 1>&2
  16. echo "$zero: $f is not a character device file"
  17. echo "$zero: use udev or aoe-mkdevs to create it"
  18. exit 1
  19. fi
  20. echo "$*" > $f || {
  21. echo "$zero: revalidate failed" 1>&2
  22. exit 1
  23. }