]>
Commit | Line | Data |
---|---|---|
2bd0ea18 NS |
1 | #!/bin/sh -f |
2 | # | |
0d3e0b37 | 3 | # Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. |
dfc130f3 | 4 | # |
2bd0ea18 NS |
5 | |
6 | OPTS="" | |
6750f2b8 | 7 | USAGE="Usage: xfs_info [-V] [-t mtab] [mountpoint|device|file]" |
2bd0ea18 | 8 | |
9440d84d | 9 | while getopts "t:V" c |
2bd0ea18 NS |
10 | do |
11 | case $c in | |
12 | t) OPTS="-t $OPTARG" ;; | |
3fda24ed | 13 | V) xfs_spaceman -p xfs_info -V |
138aab65 CH |
14 | status=$? |
15 | exit $status | |
16 | ;; | |
2bd0ea18 NS |
17 | *) echo $USAGE 1>&2 |
18 | exit 2 | |
19 | ;; | |
20 | esac | |
21 | done | |
50b1dd46 | 22 | set -- extra "$@" |
2bd0ea18 NS |
23 | shift $OPTIND |
24 | case $# in | |
6750f2b8 DW |
25 | 1) |
26 | if [ -b "$1" ] || [ -f "$1" ]; then | |
27 | xfs_db -p xfs_info -c "info" $OPTS "$1" | |
28 | status=$? | |
29 | else | |
30 | xfs_spaceman -p xfs_info -c "info" $OPTS "$1" | |
31 | status=$? | |
32 | fi | |
2bd0ea18 NS |
33 | ;; |
34 | *) echo $USAGE 1>&2 | |
35 | exit 2 | |
36 | ;; | |
37 | esac | |
38 | exit $status |