aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-04-27 17:27:33 +0200
committerBrian Behlendorf <[email protected]>2021-04-30 15:04:41 -0700
commitec4f330816134868fcf82166a3f9bfa5208f0b9c (patch)
treecec20bef6eb51192b97153c3b8fdd2e3f3c2ea0f
parent208675a09b7f7a030d1b3d38c0eb1860e609ca6b (diff)
zed.d/zed-functions.sh: fix zed_guid_to_pool() on dash
Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11935 Closes #11954
-rw-r--r--cmd/zed/zed.d/zed-functions.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd/zed/zed.d/zed-functions.sh b/cmd/zed/zed.d/zed-functions.sh
index 44a9b8d23..1fd388862 100644
--- a/cmd/zed/zed.d/zed-functions.sh
+++ b/cmd/zed/zed.d/zed-functions.sh
@@ -367,7 +367,7 @@ zed_notify_pushbullet()
#
# Notification via Slack Webhook <https://api.slack.com/incoming-webhooks>.
# The Webhook URL (ZED_SLACK_WEBHOOK_URL) identifies this client to the
-# Slack channel.
+# Slack channel.
#
# Requires awk, curl, and sed executables to be installed in the standard PATH.
#
@@ -511,10 +511,8 @@ zed_guid_to_pool()
return
fi
- guid=$(printf "%llu" "$1")
- if [ -n "$guid" ] ; then
- $ZPOOL get -H -ovalue,name guid | awk '$1=='"$guid"' {print $2}'
- fi
+ guid="$(printf "%u" "$1")"
+ $ZPOOL get -H -ovalue,name guid | awk '$1 == '"$guid"' {print $2; exit}'
}
# zed_exit_if_ignoring_this_event