add directories for ssh_agents and sockets

This commit is contained in:
Jakobus Schürz 2020-09-21 13:00:29 +02:00
parent 564d9d3c1a
commit eb41e28b25

View file

@ -35,29 +35,37 @@ if [[ $- = *i* ]] ; then
#echo "interactive shell" >&2
# define variables
# default timeouts definted in myshellconfig_load_default
# default timeouts defined in myshellconfig_load_default
#[ -z "${MYSHELLCONFIG_ROOT_TMOUT+x}" ] && MYSHELLCONFIG_ROOT_TMOUT=500
#[ -z "${MYSHELLCONFIG_USER_TMOUT+x}" ] && MYSHELLCONFIG_USER_TMOUT=0
[ -z "${USERNAME+x}" ] && export USERNAME="$USER"
[ -z "${USEREMAIL+x}" ] && export USEREMAIL="$USER@$(domainname -d)"
[ -z "${FULLNAME+x}" ] && export FULLNAME="$(getent passwd $USER | cut -d ":" -f 5 | cut -d ',' -f 1)"
[ -z "${GIT_AUTHOR_NAME+x}" ] && export GIT_AUTHOR_NAME=$FULLNAME
[ -z "${GIT_AUTHOR_EMAIL+x}" ] && export GIT_AUTHOR_EMAIL=$USEREMAIL
[ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME
[ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL
[ -z "${USERNAME+x}" ] && export USERNAME="$USER"
[ -z "${USEREMAIL+x}" ] && export USEREMAIL="$USER@$(domainname -d)"
[ -z "${FULLNAME+x}" ] && export FULLNAME="$(getent passwd $USER | cut -d ":" -f 5 | cut -d ',' -f 1)"
[ -z "${GIT_AUTHOR_NAME+x}" ] && export GIT_AUTHOR_NAME=$FULLNAME
[ -z "${GIT_AUTHOR_EMAIL+x}" ] && export GIT_AUTHOR_EMAIL=$USEREMAIL
[ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME
[ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL
[ -z "${MYSHELLCONFIG_SUBPATH+x}" ] && MYSHELLCONFIG_SUBPATH=".local/myshellconfig"
[ -z "${MYSHELLCONFIG_BASE+x}" ] && MYSHELLCONFIG_BASE="${HOME}/${MYSHELLCONFIG_SUBPATH}"
[ -z "${MYSHELLCONFIG_SUBPATH+x}" ] && MYSHELLCONFIG_SUBPATH=".local/myshellconfig"
[ -z "${MYSHELLCONFIG_BASE+x}" ] && export MYSHELLCONFIG_BASE="${HOME}/${MYSHELLCONFIG_SUBPATH}"
MYSHELLCONFIG_BASE_PARENT="$(dirname $MYSHELLCONFIG_BASE)"
[ -z "${MYSHELLCONFIG_LOGDIR+x}" ] && MYSHELLCONFIG_LOGDIR="${MYSHELLCONFIG_BASE}/logs"
[ -z "${MYSHELLCONFIG_LOGFILE+x}" ] && MYSHELLCONFIG_LOGFILE="${MYSHELLCONFIG_LOGDIR}/myshellconfig.log"
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_TIMEOUT=5s
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
[ -z "${MYSHELLCONFIG_LOGDIR+x}" ] && export MYSHELLCONFIG_LOGDIR="${MYSHELLCONFIG_BASE}/logs"
[ -z "${MYSHELLCONFIG_LOGFILE+x}" ] && export MYSHELLCONFIG_LOGFILE="${MYSHELLCONFIG_LOGDIR}/myshellconfig.log"
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_TIMEOUT=5s
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
MYSHELLCONFIG_BASH_COMPLETION="${HOME}/${MYSHELLCONFIG_SUBPATH}/bash_completion.d"
[ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && MYSHELLCONFIG_GIT_SYNC=true
[ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && MYSHELLCONFIG_GIT_SYNC=true
SGIT="git -C ${MYSHELLCONFIG_BASE}"
export MYSHELLCONFIG_BASE MYSHELLCONFIG_LOGDIR MYSHELLCONFIG_LOGFILE SGIT MYSHELLCONFIG_VIM_PLUGINS
[ -n "${SSH_AGENTS_DIR+x}" ] && export AGENTS_DIR=${HOME}/.ssh/agents
[ -n "${SSH_AGENT_SOCKETS_DIR+x}" ] && export AGENTS_DIR=${HOME}/.ssh/agents
export SGIT="git -C ${MYSHELLCONFIG_BASE}"
export MYSHELLCONFIG_VIM_PLUGINS
# Create necessary directories
mkdir -p "$SSH_AGENTS_DIR"
mkdir -p "$SSH_AGENT_SOCKETS_DIR"
mkdir -p "$MYSHELLCONFIG_LOGDIR"
cat << EOF >> "${MYSHELLCONFIG_LOGFILE}"
------- start -------------- $(date) ---------------8<--
@ -130,6 +138,7 @@ EOF
# source loading workaround for x2go to forward local etoken to remote machine with forwardagent
. "${MYSHELLCONFIG_BASE}/myshell_load_x2go_tokenforward"
cat << EOF >> "${MYSHELLCONFIG_LOGFILE}"
--8<--- end ---------------- $(date) ---------------8<--