[Drbd-dev] [PATCH 1/6] drbd.ocf: Make it possible for shellcheck to parse this script

Bart Van Assche bart.vanassche at sandisk.com
Tue Jun 14 13:54:52 CEST 2016


Shellcheck is a useful tool for verifying syntactical correctness
of shell scripts. Hence make it possible to verify this script
with shellcheck. This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche at sandisk.com>
---
 scripts/drbd.ocf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
index 632e16e..2335062 100755
--- a/scripts/drbd.ocf
+++ b/scripts/drbd.ocf
@@ -967,7 +967,7 @@ meta_expect()
 	local val=${!whatvar}
 	if [[ -n $val ]]; then
 		# [, not [[, or it won't work ;)
-		[ $val $op $expect ] && return
+		eval "[ $val $op $expect ]" && return
 	fi
 	ocf_log err "meta parameter misconfigured, expected $what $op $expect, but found ${val:-unset}."
 	exit $OCF_ERR_CONFIGURED
-- 
2.8.4




More information about the drbd-dev mailing list