diff --git a/src/libinput-restore-selinux-context.sh b/src/libinput-restore-selinux-context.sh index 7fd8fad0..3b1c555b 100644 --- a/src/libinput-restore-selinux-context.sh +++ b/src/libinput-restore-selinux-context.sh @@ -6,5 +6,7 @@ libdir="$1" sofile=$(basename "$2") -echo "Restoring SELinux context on $MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile" -restorecon "$MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile" +if command -v restorecon >/dev/null; then + echo "Restoring SELinux context on $MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile" + restorecon "$MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile" +fi