diff --git a/pinentry-wrapper b/pinentry-wrapper index 2ea4677..fd714ca 100755 --- a/pinentry-wrapper +++ b/pinentry-wrapper @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/sh # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2009 Fedora Project @@ -71,8 +71,12 @@ then elif [ -n "$DISPLAY" -a -x /usr/bin/pinentry-qt ] then export PINENTRY_BINARY="/usr/bin/pinentry-qt" -# pinentry-curses is installed by default -else +# use pinentry-curses for interactive mode +elif [ -t 0 -a -t 1 ]; +then export PINENTRY_BINARY="/usr/bin/pinentry-curses" +# fallback to pinentry-tty in no TTY is provided +else + export PINENTRY_BINARY="/usr/bin/pinentry-tty" fi exec $PINENTRY_BINARY "$@" diff --git a/pinentry.spec b/pinentry.spec index 06624a6..249fc4a 100644 --- a/pinentry.spec +++ b/pinentry.spec @@ -88,6 +88,7 @@ This package contains the emacs based version of the PIN entry dialog. --enable-pinentry-gtk2 \ --enable-pinentry-qt5 \ --enable-pinentry-emacs \ + --enable-pinentry-tty \ --enable-libsecret %make_build @@ -109,6 +110,7 @@ rm -fv $RPM_BUILD_ROOT%{_infodir}/dir %license COPYING %doc AUTHORS ChangeLog NEWS README THANKS TODO %{_bindir}/pinentry-curses +%{_bindir}/pinentry-tty %{_bindir}/pinentry %{_infodir}/pinentry.info*