diff options
author | Arshad Hussain <[email protected]> | 2021-01-24 05:22:29 +0530 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-01-24 16:06:58 -0800 |
commit | 3e33897beccc756195ca86809788cf87cd32abc7 (patch) | |
tree | 607abf1bddcd4dd9ea5fcc8f4324560454dbbfc9 | |
parent | 0f3b928e85be714d744a49c18b3385ea3bd09f03 (diff) |
vdev_id: Add error message when $CONFIG is missing
It was observed that vdev_id exists silently when
the $CONFIG file is missing.
This patch adds error message in case vdev_id is
called without default $CONFIG or '-c'. This makes
end user observe the exit message more easily.
Before Patch:
~~~~~~~~~~~~~
$ ./cmd/vdev_id/vdev_id
$
After Patch:
~~~~~~~~~~~~
$ ./cmd/vdev_id/vdev_id
Error: Config file "/etc/zfs/vdev_id.conf" not found
$
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Arshad Hussain <[email protected]>
Closes #11498
-rwxr-xr-x | cmd/vdev_id/vdev_id | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index 8a75e638b..fc79d22e9 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -545,6 +545,7 @@ while getopts 'c:d:eg:mp:h' OPTION; do done if [ ! -r $CONFIG ] ; then + echo "Error: Config file \"$CONFIG\" not found" exit 0 fi |