Statistiques
| Révision :

root / bin / zpool-get-state @ 49

Historique | Voir | Annoter | Télécharger (722 octet)

1
#!/bin/bash
2
# $Id: zpool-get-state 49 2013-10-10 08:59:11Z kreverch $
3

    
4
BINZFS="/sbin/zfs"
5
BINZPOOL="/sbin/zpool"
6

    
7
function usage {
8

    
9
  echo "Syntax :"
10
  echo "$0 -n zpool_name : display zpool state and last scrub"
11
  echo "$0 -h : display this message"
12
}
13
function nointeractive {
14
  echo $($BINZPOOL status $poolname|grep -i "state:"|sed -e "s/^ \+//g"|sed -e "s/: /:/")
15
  echo $($BINZPOOL status $poolname|grep -i "scan:"|sed -e "s/^ \+//g"|sed -e "s/: /:/")
16
  exit 0
17
}
18
while getopts "in:h" OPTION
19
do
20
     case $OPTION in
21
         h)
22
             usage
23
             exit 1
24
             ;;
25
         n)
26
            poolname=$OPTARG
27
            ;;
28
         *)
29
            usage
30
            ;;
31
     esac
32
done
33
if [[ -z $poolname ]]
34
then
35
     usage
36
     exit 1
37
fi
38

    
39
nointeractive
40

    
41