From 8a274578e2895b9f0b66c09f3a8f63b5ff1293b2 Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Wed, 16 Jan 2019 17:34:19 -0800 Subject: [PATCH] cgroup: test if CGROUP2_DIR is set with -v instead of -n common/multipath-over-rdma does set -u, so -n "$CGROUP2_DIR" fails with an unbound variable error. Instead, use -v to test if the variable was set. Signed-off-by: Omar Sandoval --- common/cgroup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cgroup b/common/cgroup index 48e546f..554ebf7 100644 --- a/common/cgroup +++ b/common/cgroup @@ -22,7 +22,7 @@ _init_cgroup2() _exit_cgroup2() { - if [[ -n $CGROUP2_DIR ]]; then + if [[ -v CGROUP2_DIR ]]; then find "$CGROUP2_DIR" -type d -delete unset CGROUP2_DIR fi -- 2.49.0