aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2021-04-27 15:27:33 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2021-04-30 22:04:41 +0000
commitec4f330816134868fcf82166a3f9bfa5208f0b9c (patch)
treecec20bef6eb51192b97153c3b8fdd2e3f3c2ea0f
parent208675a09b7f7a030d1b3d38c0eb1860e609ca6b (diff)
downloadsrc-ec4f330816134868fcf82166a3f9bfa5208f0b9c.tar.gz
src-ec4f330816134868fcf82166a3f9bfa5208f0b9c.zip
zed.d/zed-functions.sh: fix zed_guid_to_pool() on dash
Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> 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 44a9b8d23303..1fd3888625b2 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