From e2870fb24aff7a002d06022b2f264349a75458e6 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Sun, 24 Jan 2021 05:22:29 +0530 Subject: [PATCH] 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 Signed-off-by: Arshad Hussain Closes #11498 --- cmd/vdev_id/vdev_id | 1 + 1 file changed, 1 insertion(+) 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