Merge branch 'master' of /srv/git/myshellconfig
This commit is contained in:
commit
9c531618df
4 changed files with 11 additions and 5 deletions
|
@ -89,6 +89,7 @@ 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
|
||||
logwarn "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) reached"
|
||||
logwarn "check if reachable"
|
||||
if $( timeout --foreground "${MSC_GIT_TIMEOUT-$MSC_GIT_TIMEOUT_DEFAULT}" $SGIT ls-remote >/dev/null 2>&1) ;then
|
||||
logwarn "reachable"
|
||||
|
@ -99,7 +100,7 @@ EOF
|
|||
fi
|
||||
else
|
||||
local seconds=$(( $( date --date="@$(stat --printf %Y ${MSC_GIT_UPD_REPO_STATFILE} 2>/dev/null || echo 0 )" "+%s") - $(date --date="${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours ago" "+%s") ))
|
||||
logwarn "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) not reached yes. $((seconds/86400)) days $(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds") left."
|
||||
logwarn "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) not reached yet. $((seconds/86400)) days $(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds") left."
|
||||
return 2
|
||||
fi
|
||||
else
|
||||
|
|
|
@ -7,7 +7,7 @@ for f in logerror logwarn loginfo logdebug logtrace ENTRY EXIT SCRIPTENTRY SCRIP
|
|||
:
|
||||
else
|
||||
fx=${f//log/}
|
||||
#echo create function $f for $fx
|
||||
echo create function $f for $fx
|
||||
eval "$f () { \
|
||||
local loglevels; \
|
||||
declare -a loglevels; \
|
||||
|
|
|
@ -362,7 +362,7 @@ sshs() {
|
|||
done
|
||||
fi
|
||||
echo "FILELIST: $FILELIST"
|
||||
local SSH_OPTS="-o VisualHostKey=no -o ControlMaster=auto -o ControlPersist=15s -o ControlPath=~/.ssh/ssh-%r@%h:%p"
|
||||
local SSH_OPTS="-o VisualHostKey=no -o ControlMaster=yes -o ControlPersist=15s -o ControlPath=~/.ssh/ssh-%n-%C"
|
||||
# Read /etc/bashrc or /etc/bash.bashrc (depending on distribution) and /etc/profile.d/*.sh first
|
||||
cat << EOF >> "${TMPBASHCONFIG}"
|
||||
[ -e /etc/bashrc ] && BASHRC=/etc/bashrc
|
||||
|
@ -398,7 +398,9 @@ EOF
|
|||
if [ $# -ge 1 ]; then
|
||||
if [ -e "${TMPBASHCONFIG}" ] ; then
|
||||
local RCMD="/bin/bash --noprofile --norc -c "
|
||||
logdebug "create remote bashrc"
|
||||
local REMOTETMPBASHCONFIG=$(ssh -T ${SSH_OPTS} $@ "mktemp -p \${XDG_RUNTIME_DIR-~} -t bashrc.XXXXXXXX --suffix=.conf"| tr -d '[:space:]' )
|
||||
logdebug "create remote vimrc"
|
||||
local REMOTETMPVIMCONFIG=$(ssh -T ${SSH_OPTS} $@ "mktemp -p \${XDG_RUNTIME_DIR-~} -t vimrc.XXXXXXXX --suffix=.conf"| tr -d '[:space:]')
|
||||
|
||||
# Add additional aliases to bashrc for remote-machine
|
||||
|
@ -413,10 +415,13 @@ title "\$USER@\$HOSTNAME: \$PWD"
|
|||
loginfo "This bash runs with temporary config from \$BASHRC"
|
||||
EOF
|
||||
|
||||
logdebug "create fill remote bashrc"
|
||||
ssh -T ${SSH_OPTS} $@ "cat > ${REMOTETMPBASHCONFIG}" < "${TMPBASHCONFIG}"
|
||||
logdebug "create fill remote vimrc"
|
||||
ssh -T ${SSH_OPTS} $@ "cat > ${REMOTETMPVIMCONFIG}" < "${MSC_BASE}/vimrc"
|
||||
RCMD="
|
||||
trap \"rm -f ${REMOTETMPBASHCONFIG} ${REMOTETMPVIMCONFIG}\" EXIT " ;
|
||||
logdebug "run remote shell with temporary config"
|
||||
ssh -t ${SSH_OPTS} $@ "$RCMD; SSHS=true bash -c \"function bash () { /bin/bash --rcfile ${REMOTETMPBASHCONFIG} -i ; } ; export -f bash; exec bash --rcfile ${REMOTETMPBASHCONFIG}\""
|
||||
rm "${TMPBASHCONFIG}"
|
||||
else
|
||||
|
|
4
vimrc
4
vimrc
|
@ -271,8 +271,8 @@ nnoremap <C-L> <C-W><C-L>
|
|||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
" Map :next to <C-TAB>
|
||||
nmap <C-Tab> :next<CR>
|
||||
nmap <C-S-Tab> :prev<CR>
|
||||
nmap <C-Tab> :tabNext<CR>
|
||||
nmap <C-S-Tab> :tabPrev<CR>
|
||||
nmap <C-t> :tabnew<CR>
|
||||
"------------------------------------------------------------
|
||||
let g:SimplyFold_docstring_preview=1
|
||||
|
|
Loading…
Reference in a new issue