]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - db/xfs_ncheck.sh
xfsprogs: Release v6.8.0
[thirdparty/xfsprogs-dev.git] / db / xfs_ncheck.sh
CommitLineData
2bd0ea18 1#!/bin/sh -f
959ef981 2# SPDX-License-Identifier: GPL-2.0
2bd0ea18 3#
0d3e0b37 4# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
dfc130f3 5#
2bd0ea18
NS
6
7OPTS=" "
add013da
NS
8DBOPTS=" "
9USAGE="usage: xfs_ncheck [-sfV] [-l logdev] [-i ino]... special"
2bd0ea18
NS
10
11
add013da 12while getopts "b:fi:l:svV" c
2bd0ea18
NS
13do
14 case $c in
15 s) OPTS=$OPTS"-s ";;
16 i) OPTS=$OPTS"-i "$OPTARG" ";;
9440d84d 17 v) OPTS=$OPTS"-v ";;
add013da
NS
18 f) DBOPTS=$DBOPTS" -f";;
19 l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
138aab65
CH
20 V) xfs_db -p xfs_ncheck -V
21 status=$?
22 exit $status
23 ;;
2bd0ea18
NS
24 \?) echo $USAGE 1>&2
25 exit 2
26 ;;
27 esac
28done
29set -- extra $@
30shift $OPTIND
31case $# in
add013da 32 1) xfs_db$DBOPTS -r -p xfs_ncheck -c "blockget -ns" -c "ncheck$OPTS" $1
2bd0ea18
NS
33 status=$?
34 ;;
35 *) echo $USAGE 1>&2
36 exit 2
37 ;;
38esac
39exit $status