From d4516a55a6013df85ddb8985e43b68fe08c15265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Mon, 23 Jan 2023 08:30:31 +0100 Subject: [PATCH 1/4] set pushurl from pullurl when configured --- functions.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index 52dc9ae..c442e01 100755 --- a/functions.sh +++ b/functions.sh @@ -1351,7 +1351,13 @@ setgitremote() { git remote set-url ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PULLURL:-$MSC_GIT_PULLURL_DEFAULT} - git remote set-url --push ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PUSHURL:-$MSC_GIT_PUSHURL_DEFAULT} + # sequence for push-url + # configured pushurl from .bashrc + # configured pullurl from .bashrc (if no pushrul is defined and pushurl is the same as pullurl) + # default pushurl (if no push or pullurl is defined in .bashrc) + # default pullurl (if no push/pull/default_pushurl is defined, then default pushurl is the same as default pullurl) + git remote set-url --push ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} \ + ${MSC_GIT_PUSHURL:-${MSC_GIT_PULLURL:-${MSC_GIT_PUSHURL_DEFAULT:-$MSC_GIT_PULLURL_DEFAULT}}} git branch -u "${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT}"/"${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT}" git checkout ${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT} loginfo "now remotes are: $(git remote -v)" From 28aabb649e45e21d8bf0bb10897e49429ec7a6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 27 Jan 2023 16:42:52 +0100 Subject: [PATCH 2/4] remove output when Session "User" not exist --- myshell_load_defaults | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/myshell_load_defaults b/myshell_load_defaults index a29bd1c..c6bd5b6 100644 --- a/myshell_load_defaults +++ b/myshell_load_defaults @@ -91,8 +91,9 @@ if ! $SSHS; then if test ! $TMUX && test $TERM != screen; then loginfo "no screen" # if test $(systemctl status tmux@${USER}.service 1>/dev/null 2>&1; echo $? ) -eq 0; then - if tmux has-session -t User || tmux has-session -t "${USER}"; then + if tmux has-session -t User > /dev/null || tmux has-session -t "${USER}"; then loginfo "tmux@${USER} is running" + loginfo "$(tmux list-sessions)" STARTTMUXDEFAULT=${STARTTMUXREMOTEDEFAULT} fi fi From 60dd36b8075f5ccdfaafb89a93b3b3c6af91ac7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 27 Jan 2023 16:43:30 +0100 Subject: [PATCH 3/4] change ControlMaster --- sshs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sshs b/sshs index 4050171..e18519b 100644 --- a/sshs +++ b/sshs @@ -22,7 +22,8 @@ sshs() { done fi logdebug "FILELIST1: ${FILELIST[@]}" - local SSH_OPTS="-o VisualHostKey=no -o ControlMaster=auto -o ControlPersist=20s -o ControlPath=~/.ssh/master-%C" + local SSH_OPTS="-o VisualHostKey=no -o ControlMaster=auto -o ControlPersist=20s" + #local SSH_OPTS="-o VisualHostKey=no -o ControlMaster=auto -o ControlPersist=20s -o ControlPath=~/.ssh/master-%C" #local SSH_OPTS="-o VisualHostKey=no -o ControlMaster=yes -o ControlPersist=10s -o ControlPath=~/.ssh/ssh-%C" # Read /etc/bashrc or /etc/bash.bashrc (depending on distribution) and /etc/profile.d/*.sh first #ssh -T ${SSH_OPTS} $@ "pwd" >/dev/null 2>/dev/null || { logerror "Server $@ not reachable -> exit"; return 1; } From e733d4cce00947551e70f5ab2858f22ded7b8612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 20 Jan 2023 21:51:12 +0100 Subject: [PATCH 4/4] move and introduce new defaults --- bashrc_add | 4 ++-- defaults.conf | 3 +++ defaults.conf.sample | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bashrc_add b/bashrc_add index 033fb7d..ef0f27b 100755 --- a/bashrc_add +++ b/bashrc_add @@ -76,8 +76,8 @@ if [[ $- = *i* ]] ; then [ -z "${P11M:+x}" ] && [ -n "$(whereis p11-kit-proxy.so|awk '{print $2}')" ] && export P11M=$(whereis p11-kit-proxy.so|awk '{print $2}' || { echo "p11-kit-proxy not forwarded by ssh or installed, unset P11M"; unset P11M; }) # Basics - [ -z "${VISUAL+x}" ] && export VISUAL=vim - [ -z "${EDITOR+x}" ] && export EDITOR=vim + [ -z "${VISUAL+x}" ] && export VISUAL=${VISUAL_DEFAULT} + [ -z "${EDITOR+x}" ] && export EDITOR=${EDITOR_DEFAULT} cat << EOF >> "${MSC_LOGFILE}" ==8<=== start configure new shell ============== $(date) ===============8<== diff --git a/defaults.conf b/defaults.conf index 21b59cd..083299c 100644 --- a/defaults.conf +++ b/defaults.conf @@ -30,3 +30,6 @@ export TRASHMAIL_HASHED_DEFAULT=true export SSH_CERT_VALIDITY_WARN_SEC="14 days" +### OTHER STUFF ### +VISUAL_DEFAUTL=vim +EDITOR_DEFAULT=vim diff --git a/defaults.conf.sample b/defaults.conf.sample index cc68734..8c468d8 100644 --- a/defaults.conf.sample +++ b/defaults.conf.sample @@ -29,3 +29,7 @@ export TRASHMAIL_TARGET_MAIL_DEFAULT=user@example.com export TRASHMAIL_HASHED_DEFAULT=true export SSH_CERT_VALIDITY_WARN_SEC="14 days" + +### OTHER STUFF ### +VISUAL_DEFAUTL=vim +EDITOR_DEFAULT=vim