From: Frank Brehm Date: Thu, 11 Aug 2016 05:55:37 +0000 (+0200) Subject: saving uncommitted changes in /etc prior to emerge run X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=48df52a2629b03f699134c449e1c9ec3c5ffb7e6;p=config%2Fbruni%2Fetc.git saving uncommitted changes in /etc prior to emerge run --- diff --git a/config-archive/etc/plasma/shutdown/10-agent-shutdown.sh b/config-archive/etc/plasma/shutdown/10-agent-shutdown.sh new file mode 100644 index 00000000..66b97af9 --- /dev/null +++ b/config-archive/etc/plasma/shutdown/10-agent-shutdown.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# This file is executed at plasma shutdown. +# Uncomment the following lines to kill the agents +# that were started at session startup. + +if [ -n "${GPG_AGENT_INFO}" ]; then + kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1 +fi + +if [ -n "${SSH_AGENT_PID}" ]; then + eval "$(ssh-agent -s -k)" +fi diff --git a/config-archive/etc/plasma/shutdown/10-agent-shutdown.sh.dist b/config-archive/etc/plasma/shutdown/10-agent-shutdown.sh.dist new file mode 100644 index 00000000..4bafd2e6 --- /dev/null +++ b/config-archive/etc/plasma/shutdown/10-agent-shutdown.sh.dist @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This file is executed at Plasma shutdown. +# Uncomment the following lines to kill the agents +# that were started at session startup. + +# gnupg 2.0.x +#if [ -n "${GPG_AGENT_INFO}" ]; then +# kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1 +#fi + +# gnupg 2.1.x +#gpgconf --kill gpg-agent >/dev/null 2>&1 + +#if [ -n "${SSH_AGENT_PID}" ]; then +# eval "$(ssh-agent -s -k)" +#fi diff --git a/config-archive/etc/plasma/startup/10-agent-startup.sh b/config-archive/etc/plasma/startup/10-agent-startup.sh new file mode 100644 index 00000000..3e8a8201 --- /dev/null +++ b/config-archive/etc/plasma/startup/10-agent-startup.sh @@ -0,0 +1,29 @@ +# Agents startup file +# +# This file is sourced at plasma startup, so that +# the environment variables set here are available +# throughout the session. + +# Uncomment the following lines to start gpg-agent +# and/or ssh-agent at plasma startup. +# If you do so, do not forget to uncomment the respective +# lines in PLASMADIR/shutdown/agent-shutdown.sh to +# properly kill the agents when the session ends. + +if [ -x /usr/bin/gpg-agent ]; then + eval "$(/usr/bin/gpg-agent --daemon)" +fi + +if [ -x /usr/bin/ssh-agent ]; then + eval "$(/usr/bin/ssh-agent -s)" +fi + +# Uncomment the following lines to start rxvt-unicode which has the ability to +# run multiple terminals in one single process, thus starting up faster and +# saving resources. +# The --opendisplay ensures that the daemon quits when the X server terminates, +# therefore we don't need matching lines in agent-shutdown.sh. + +if [ -x /usr/bin/urxvtd ]; then + /usr/bin/urxvtd --opendisplay --fork --quiet +fi diff --git a/config-archive/etc/plasma/startup/10-agent-startup.sh.dist b/config-archive/etc/plasma/startup/10-agent-startup.sh.dist new file mode 100644 index 00000000..e2c50188 --- /dev/null +++ b/config-archive/etc/plasma/startup/10-agent-startup.sh.dist @@ -0,0 +1,54 @@ +# Agents startup file +# +# This file is sourced at Plasma startup, so that +# the environment variables set here are available +# throughout the session. +# +# Uncomment the following lines to start gpg-agent +# and/or ssh-agent at Plasma startup. +# If you do so, do not forget to uncomment the respective +# lines in PLASMADIR/shutdown/agent-shutdown.sh to +# properly kill the agents when the session ends. +# +# If using gpg-agent for ssh instead of ssh-agent, a GUI pinentry program +# must be selected either with eselect pinentry or adding an entry to +# $HOME/.gnupg/gpg-agent.conf such as "pinentry-program /usr/bin/pinentry-qt4". +# +# pinentry-curses or pinentry-tty will not work because the agent started here +# is in a different tty than where it is used, so the agent does not know where +# to request the passphrase and fails. + +#GPG_AGENT=true +#SSH_AGENT=true +#SSH_AGENT=gpg # use gpg-agent for ssh instead of ssh-agent + +if [ "${GPG_AGENT}" = true ]; then + if [ -x /usr/bin/gpgconf ]; then + gpgconf --launch gpg-agent >/dev/null 2>&1 + if [ $? = 2 ]; then + eval "$(/usr/bin/gpg-agent --enable-ssh-support --daemon)" + fi + fi +fi + +if [ "${SSH_AGENT}" = true ]; then + if [ -x /usr/bin/ssh-agent ]; then + eval "$(/usr/bin/ssh-agent -s)" + fi +elif [ "${SSH_AGENT}" = gpg ] && [ "${GPG_AGENT}" = true ]; then + if [ -e /run/user/$(id -ru)/gnupg/S.gpg-agent.ssh ]; then + export SSH_AUTH_SOCK=/run/user/$(id -ru)/gnupg/S.gpg-agent.ssh + elif [ -e "${HOME}/.gnupg/S.gpg-agent.ssh" ]; then + export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh + fi +fi + +# Uncomment the following lines to start rxvt-unicode which has the ability to +# run multiple terminals in one single process, thus starting up faster and +# saving resources. +# The --opendisplay ensures that the daemon quits when the X server terminates, +# therefore we don't need matching lines in agent-shutdown.sh. + +#if [ -x /usr/bin/urxvtd ]; then +# /usr/bin/urxvtd --opendisplay --fork --quiet +#fi diff --git a/plasma/shutdown/10-agent-shutdown.sh b/plasma/shutdown/10-agent-shutdown.sh index 66b97af9..4bafd2e6 100644 --- a/plasma/shutdown/10-agent-shutdown.sh +++ b/plasma/shutdown/10-agent-shutdown.sh @@ -1,13 +1,17 @@ #!/bin/sh # -# This file is executed at plasma shutdown. +# This file is executed at Plasma shutdown. # Uncomment the following lines to kill the agents # that were started at session startup. -if [ -n "${GPG_AGENT_INFO}" ]; then - kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1 -fi +# gnupg 2.0.x +#if [ -n "${GPG_AGENT_INFO}" ]; then +# kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1 +#fi -if [ -n "${SSH_AGENT_PID}" ]; then - eval "$(ssh-agent -s -k)" -fi +# gnupg 2.1.x +#gpgconf --kill gpg-agent >/dev/null 2>&1 + +#if [ -n "${SSH_AGENT_PID}" ]; then +# eval "$(ssh-agent -s -k)" +#fi diff --git a/plasma/startup/10-agent-startup.sh b/plasma/startup/10-agent-startup.sh index 3e8a8201..e2c50188 100644 --- a/plasma/startup/10-agent-startup.sh +++ b/plasma/startup/10-agent-startup.sh @@ -1,29 +1,54 @@ # Agents startup file # -# This file is sourced at plasma startup, so that +# This file is sourced at Plasma startup, so that # the environment variables set here are available # throughout the session. - +# # Uncomment the following lines to start gpg-agent -# and/or ssh-agent at plasma startup. +# and/or ssh-agent at Plasma startup. # If you do so, do not forget to uncomment the respective # lines in PLASMADIR/shutdown/agent-shutdown.sh to # properly kill the agents when the session ends. +# +# If using gpg-agent for ssh instead of ssh-agent, a GUI pinentry program +# must be selected either with eselect pinentry or adding an entry to +# $HOME/.gnupg/gpg-agent.conf such as "pinentry-program /usr/bin/pinentry-qt4". +# +# pinentry-curses or pinentry-tty will not work because the agent started here +# is in a different tty than where it is used, so the agent does not know where +# to request the passphrase and fails. -if [ -x /usr/bin/gpg-agent ]; then - eval "$(/usr/bin/gpg-agent --daemon)" -fi +#GPG_AGENT=true +#SSH_AGENT=true +#SSH_AGENT=gpg # use gpg-agent for ssh instead of ssh-agent -if [ -x /usr/bin/ssh-agent ]; then - eval "$(/usr/bin/ssh-agent -s)" +if [ "${GPG_AGENT}" = true ]; then + if [ -x /usr/bin/gpgconf ]; then + gpgconf --launch gpg-agent >/dev/null 2>&1 + if [ $? = 2 ]; then + eval "$(/usr/bin/gpg-agent --enable-ssh-support --daemon)" + fi + fi +fi + +if [ "${SSH_AGENT}" = true ]; then + if [ -x /usr/bin/ssh-agent ]; then + eval "$(/usr/bin/ssh-agent -s)" + fi +elif [ "${SSH_AGENT}" = gpg ] && [ "${GPG_AGENT}" = true ]; then + if [ -e /run/user/$(id -ru)/gnupg/S.gpg-agent.ssh ]; then + export SSH_AUTH_SOCK=/run/user/$(id -ru)/gnupg/S.gpg-agent.ssh + elif [ -e "${HOME}/.gnupg/S.gpg-agent.ssh" ]; then + export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh + fi fi # Uncomment the following lines to start rxvt-unicode which has the ability to -# run multiple terminals in one single process, thus starting up faster and +# run multiple terminals in one single process, thus starting up faster and # saving resources. # The --opendisplay ensures that the daemon quits when the X server terminates, # therefore we don't need matching lines in agent-shutdown.sh. -if [ -x /usr/bin/urxvtd ]; then - /usr/bin/urxvtd --opendisplay --fork --quiet -fi +#if [ -x /usr/bin/urxvtd ]; then +# /usr/bin/urxvtd --opendisplay --fork --quiet +#fi