]> git.proxmox.com Git - mirror_zfs.git/commitdiff
vdev_id: Add error message when $CONFIG is missing
authorArshad Hussain <arshad.super@gmail.com>
Sat, 23 Jan 2021 23:52:29 +0000 (05:22 +0530)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 25 Jan 2021 00:06:58 +0000 (16:06 -0800)
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 <behlendorf1@llnl.gov>
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Closes #11498

cmd/vdev_id/vdev_id

index 8a75e638b67ecf766c648b0df54d9e114b37267d..fc79d22e9927da3748942978afd0e2d5b526b247 100755 (executable)
@@ -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