diff --git a/src/appimage/AppRun b/src/appimage/AppRun index 030f6267..7f69dfe3 100755 --- a/src/appimage/AppRun +++ b/src/appimage/AppRun @@ -1,141 +1,141 @@ #! /usr/bin/env bash this_dir="$(readlink -f "$(dirname "$0")")" if [ "$1" = "--debug" ]; then shift set -x else set -e fi if [ -f "${APPDIR}/GnuPG-VS-Desktop-VERSION" ]; then myname="GnuPG VS-Desktop "$(cat "${APPDIR}/GnuPG-VS-Desktop-VERSION") else myname="GnuPG Desktop "$(cat "${APPDIR}/GnuPG-Desktop-VERSION") fi if [ "$1" = "--help" -o "$1" = "--version" ]; then echo "$myname" if [ "$1" = "--help" ]; then cat <&2 exit 2 fi fi exit 0 fi export PATH="${APPDIR}/usr/bin:${PATH}" export XDG_DATA_DIRS="${APPDIR}/usr/share:${XDG_DATA_DIRS:-/usr/share}:/usr/share" export XDG_CONFIG_DIRS="${APPDIR}/usr/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}:/etc/xdg" # Allow GnuPG config scripts to detect the appimage install. We can't # rely on APPDIR because other appimages might come with their own # gnupg version. Change the value to "vsd" for a GnuPG VS-Desktop build. if [ -f "${APPDIR}/GnuPG-VS-Desktop-VERSION" ]; then _gnupg_appimage=vsd prestart_snippet=/etc/gnupg-vsd/apprun.pre-start.sh else _gnupg_appimage=generic prestart_snippet=/etc/gnupg/apprun.pre-start.sh fi export _gnupg_appimage if [ -z "$SHELL" ]; then SHELL="$(grep '/bash$' /etc/shells 2>/dev/null)" if [ -z "$SHELL" ]; then export SHELL=/bin/bash fi fi mycleanup () { if [ -n $"gnupg_SETUPINIFILE" ]; then rm -f $"gnupg_SETUPINIFILE" fi } gnupg_SETUPINIFILE= trap mycleanup 0 INT QUIT if [ "$1" = "-c" -o "$1" = "-i" ]; then shift if [ ! -x "$SHELL" ]; then echo "error: no shell found" >&2 exit 2 fi if [ -n "$1" ]; then pgm="$SHELL" pgmargs="-c $@" else export gnupg_SETUPINIFILE SHELL if [ $(id -u) -eq 0 -a ! -d /etc/gnupg-vsd ]; then echo "no global configuration - installing default" >&2 mkdir /etc/gnupg-vsd cp "${APPDIR}"/usr/share/gnupg/conf/gnupg-vsd/* /etc/gnupg-vsd/ fi if echo "$SHELL" | grep '/bash$' >/dev/null 2>&1; then pgm="${APPDIR}/start-shell" pgmargs= gnupg_SETUPINIFILE="/tmp/gnupg-tmp.$(id -u).$$.ini" else pgm="$SHELL" pgmargs="-i" fi echo Welcome to "$myname"\! >&2 echo "(type \"exit\" to leave)" >&2 echo "" >&2 fi else if [ $(id -u) -eq 0 ]; then echo "error: the GUI may not be run by root" >&2 exit 2 fi # Ignore the optional --gui option if [ "$1" = "--gui" ]; then shift fi if [ -x "${this_dir}/usr/bin/kleopatra" ];then pgm="${this_dir}/usr/bin/kleopatra" pgmargs="$@" else echo "Kleopatra not found" >&2 exit 2 fi fi # The admin may tweak this script by creating a snippet to be sourced # here. For example, this can be used to set a different per user -# GNUPGHOME so that the entire installation will be separate form the +# GNUPGHOME so that the entire installation will be separate from the # system's standard configuration. if [ -f $prestart_snippet ]; then . $prestart_snippet fi # Start gpg-agent launching a program. gpg-agent will then watch for # termination of the program and kill itself after this has been # detected. We also steal an existing socket so that already running # system instances of gpg-agent are not anymore used. "${this_dir}/usr/bin/gpg-agent" --steal-socket --daemon -- $pgm $pgmargs echo Goodbye from "$myname"\! >&2