Merge branch 'master' of /srv/git/myshellconfig

This commit is contained in:
Jakobus Schürz 2020-11-10 16:16:29 +01:00
commit 1cadb1b598
9 changed files with 21 additions and 14 deletions

2
.gitignore vendored
View file

@ -10,4 +10,4 @@ serverconfig.local.conf
bashrc_local
.local_scripts
.git-token
.last_udate_submodules
.last_update_submodules

View file

@ -56,7 +56,7 @@ if [[ $- = *i* ]] ; then
[ -z "${MYSHELLCONFIG_LOGDIR+x}" ] && export MYSHELLCONFIG_LOGDIR="${HOME}/logs"
[ -z "${MYSHELLCONFIG_LOGFILE+x}" ] && export MYSHELLCONFIG_LOGFILE="${MYSHELLCONFIG_LOGDIR}/myshellconfig.log"
[ -z "${MYHSELLCONFIG_LOGLEVEL_DEFAULT+x}" ] && export MYHSELLCONFIG_LOGLEVEL_DEFAULT="INFO"
[ -z "${MYHSELLCONFIG_FILELOGLEVEL_DEFAULT+x}" ] && export MYHSELLCONFIG_FILELOGLEVEL_DEFAULT="INFO"
[ -z "${MYHSELLCONFIG_FILELOGLEVEL_DEFAULT+x}" ] && export MYHSELLCONFIG_FILELOGLEVEL_DEFAULT="DEBUG"
[ -z "${SCRIPT_LOG+x}" ] && export SCRIPT_LOG="${MYSHELLCONFIG_LOGFILE}"
[ -z "${LOGLEVEL_DEFAULT+x}" ] && export LOGLEVEL_DEFAULT="${MYHSELLCONFIG_LOGLEVEL_DEFAULT-INFO}"
[ -z "${FILELOGLEVEL_DEFAULT+x}" ] && export FILELOGLEVEL_DEFAULT="${MYHSELLCONFIG_FILELOGLEVEL_DEFAULT-INFO}"

View file

@ -39,7 +39,7 @@ case $1 in
PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}"
;;
-s)
GIT_FETCH_OPTIONS="--recurse-submodules"
dosubmodupdate="true"
;;
*)
PRE=""
@ -54,11 +54,14 @@ esac
# Check for updates in submodules only if last check was INTERVALL hours in the past
updated=$(cat ${MYSHELLCONFIG_BASE%/}${MYSHELLCONFIG_BASE:+/}.last_update_submodules 2>/dev/null || echo 0 )
if [ $updated -lt $(date --date="${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_INTERVALL} hours ago" "+%s") ]; then
GIT_FETCH_OPTIONS="--recurse-submodules"
dosubmodupdate="true"
fi
#echo $SGIT fetch ${MYSHELLCONFIG_GIT_REMOTE_NAME} -p 1>&2
$SGIT fetch ${GIT_FETCH_OPTIONS} ${MYSHELLCONFIG_GIT_REMOTE_NAME} -p 2>>"${MYSHELLCONFIG_LOGFILE}"|| { logwarn fetch failed; gitupdateend; exit 1; }
$SGIT fetch ${dosubmodupdate:+--recurse-submodules} ${MYSHELLCONFIG_GIT_REMOTE_NAME} -p 2>>"${MYSHELLCONFIG_LOGFILE}"|| { logwarn fetch failed; gitupdateend; exit 1; }
if ${dosubmodupdate:-false}; then
date "+%s" > ${MYSHELLCONFIG_BASE%/}${MYSHELLCONFIG_BASE:+/}.last_update_submodules
fi
echo "Check for local changes:" >> "${MYSHELLCONFIG_LOGFILE}"
if $SGIT diff-index --ignore-submodules --exit-code HEAD -- >> "${MYSHELLCONFIG_LOGFILE}" ; then
@ -92,12 +95,16 @@ EOF
fi
logwarn "
repo synced"
if ${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE-${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_DEFAULT-true}}; then
if [ $updated -lt $(date --date="${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_INTERVALL} hours ago" "+%s") ]; then
if ${dosubmodupdate:-false}; then
logdebug "$($SGIT submodule update --remote)"
logdebug "$($SGIT commit -a -m 'update submodules')"
date "+%s" > ${MYSHELLCONFIG_BASE%/}${MYSHELLCONFIG_BASE:+/}.last_udate_submodules
date "+%s" > ${MYSHELLCONFIG_BASE%/}${MYSHELLCONFIG_BASE:+/}.last_update_submodules
logwarn "
submodules synced"
fi
else
loginfo -n ", submodules not synced"

View file

@ -283,8 +283,8 @@ agent-load-identity-keys () {
fi
done
fi
logdebug "currently loaded keys after action:
$(ssh-runinagent $agentfile ssh-add -l)"
loginfo "currently loaded keys after action: $(ssh-runinagent $agentfile ssh-add -l|wc -l)"
logdebug "$(ssh-runinagent $agentfile ssh-add -l)"
else
logwarn "ssh-identity $ssh_identity is not configured. Please create $identitydir and add keys"
fi

@ -1 +1 @@
Subproject commit e3e76fa8c55365bdfab785249787eb02a8bb5bf4
Subproject commit d099941360e061587bf7d42cd029c91650ef5a44

@ -1 +1 @@
Subproject commit 5788b1c6df63bc31ae93d6c1a3523e0602c60901
Subproject commit 63741646a9e87bbe105674747555aded6f52c490

@ -1 +1 @@
Subproject commit 44b7b729381738cef0fc28a35fbe78fc2abe4d48
Subproject commit 5f2421fa3952311df652d9e2994774e6b0d9c7cd

@ -1 +1 @@
Subproject commit 3dafdfc0424716bae21f5340314f7d90a9ddf4f2
Subproject commit cd6f16978d5af4b9fb861be9d728732d72789df3

@ -1 +1 @@
Subproject commit 696a6ed389e5b54c8bf480f44ee4e8fc59e6f903
Subproject commit 987a33355ef424161fdbc4e5d625b5b5aed9704c