change variable-name and logging
This commit is contained in:
parent
9a31a164dd
commit
f7f0fed99d
1 changed files with 6 additions and 6 deletions
12
bashrc_add
12
bashrc_add
|
@ -49,7 +49,7 @@ if [[ $- = *i* ]] ; then
|
||||||
[ -z "${MSC_GIT_SYNC+x}" ] && export MSC_GIT_SYNC=true
|
[ -z "${MSC_GIT_SYNC+x}" ] && export MSC_GIT_SYNC=true
|
||||||
|
|
||||||
# hardcoded git
|
# 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 ) \
|
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
|
-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 "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
|
# 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
|
# git fetch --dry-run --verbose
|
||||||
if $( timeout --foreground "${MSC_GIT_TIMEOUT-$MSC_GIT_TIMEOUT_DEFAULT}" $SGIT fetch --dry-run >/dev/null 2>&1) ;then
|
if $MSC_GIT fetch --dry-run >/dev/null 2>&1 ;then
|
||||||
logwarning "reachable"
|
loginfo "reachable"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
logwarning "not reachable"
|
logwarning "$($MSC_GIT rev-parse --abbrev-ref @{u} 2>/dev/null | cut -d'/' -f1) not reachable"
|
||||||
return 3
|
return 3
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue