"Fossies" - the Fresh Open Source Software Archive

Member "aoe-aoe6-86/aoetools-36/aoe-revalidate.in" (4 Jul 2015, 546 Bytes) of archive /linux/misc/aoe-aoe6-86.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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