From f7f0fed99d3aa95e524c2c1672a51cfe18a85c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 21 Oct 2022 10:50:39 +0200 Subject: [PATCH] change variable-name and logging --- bashrc_add | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bashrc_add b/bashrc_add index 74fd29c..0d05451 100755 --- a/bashrc_add +++ b/bashrc_add @@ -49,7 +49,7 @@ if [[ $- = *i* ]] ; then [ -z "${MSC_GIT_SYNC+x}" ] && export MSC_GIT_SYNC=true # hardcoded git - export SGIT="git -C ${MSC_BASE}" + export MSC_GIT="git -C ${MSC_BASE}" @@ -94,15 +94,15 @@ EOF if [ $(stat --printf %Y ${MSC_GIT_UPD_REPO_STATFILE} 2>/dev/null || echo 0 ) \ -lt $(date --date="${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours ago" "+%s") ]; then logwarning "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) reached" - logwarning "check if reachable" + loginfo "check if remote »$($MSC_GIT rev-parse --abbrev-ref @{u} 2>/dev/null | cut -d'/' -f1)« is reachable" # git ls-remote -# if $( timeout --foreground "${MSC_GIT_TIMEOUT-$MSC_GIT_TIMEOUT_DEFAULT}" $SGIT ls-remote >/dev/null 2>&1) ;then +# if $( timeout --foreground "${MSC_GIT_TIMEOUT-$MSC_GIT_TIMEOUT_DEFAULT}" $MSC_GIT ls-remote >/dev/null 2>&1) ;then # git fetch --dry-run --verbose - if $( timeout --foreground "${MSC_GIT_TIMEOUT-$MSC_GIT_TIMEOUT_DEFAULT}" $SGIT fetch --dry-run >/dev/null 2>&1) ;then - logwarning "reachable" + if $MSC_GIT fetch --dry-run >/dev/null 2>&1 ;then + loginfo "reachable" return 0 else - logwarning "not reachable" + logwarning "$($MSC_GIT rev-parse --abbrev-ref @{u} 2>/dev/null | cut -d'/' -f1) not reachable" return 3 fi else