From 8ff71530190ef41b09e6ee716698dc2a083210e8 Mon Sep 17 00:00:00 2001 From: alexzorin Date: Sat, 4 Sep 2021 00:47:12 +1000 Subject: [PATCH] snap: revert to checking snapctl file existence (#9018) While the previous approach of testing the functionality of snapctl worked, the snapd developers told us they could not guarantee its reliability. --- As with #8955, I tested this on Debian 9, 10 and CentOS 7, 8, Stream. --- snap/hooks/prepare-plug-plugin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/hooks/prepare-plug-plugin b/snap/hooks/prepare-plug-plugin index 08738a5ae..5765fdfb4 100644 --- a/snap/hooks/prepare-plug-plugin +++ b/snap/hooks/prepare-plug-plugin @@ -7,9 +7,9 @@ SNAPCTL_CORE="/snap/core/current/usr/bin/snapctl" SNAPCTL_SNAPD="/snap/snapd/current/usr/bin/snapctl" SNAPCTL="snapctl" -if $SNAPCTL_CORE get x 2>/dev/null; then +if [ -x $SNAPCTL_CORE ]; then SNAPCTL=$SNAPCTL_CORE -elif $SNAPCTL_SNAPD get x 2>/dev/null; then +elif [ -x $SNAPCTL_SNAPD ]; then SNAPCTL=$SNAPCTL_SNAPD fi