funny typo and additional checks

This commit is contained in:
Uwe Werler 2016-08-29 07:21:18 +02:00
parent b07071bc18
commit d6523c9fc0

9
SSH.sh
View File

@ -64,7 +64,7 @@ _checkname(){
if [[ -z ${_ip} ]]; then if [[ -z ${_ip} ]]; then
_host=$(dig +short -x $2) _host=$(dig +short -x $2)
[[ -n "$_host" ]] && _host=${_host%%.*} || _host=$2 [[ -n "${_host}" ]] && _host=${_host%%.*} || _host=$2
else else
_host=${2%%.*} _host=${2%%.*}
@ -140,7 +140,7 @@ _setwin(){
done done
# workaround as long as tmux crashes by setting "renumber-windows on" and hook # workaround as long as tmux crashes by setting "renumber-windows on" and hook
# "after-join-pane" or "after-move-pain" at the same time # "after-join-pane" or "after-move-pane" at the same time
$_tmux move-window -r -t ${_sess} $_tmux move-window -r -t ${_sess}
$_tmux refresh-client -S 2>/dev/null $_tmux refresh-client -S 2>/dev/null
} }
@ -167,7 +167,7 @@ _ssh() {
trap "$_setenv -ur $TMUX_PANE; sh $0 -r" INT EXIT trap "$_setenv -ur $TMUX_PANE; sh $0 -r" INT EXIT
$_setenv $TMUX_PANE ${_host} [[ -n ${_host} ]] && $_setenv $TMUX_PANE ${_host}
_setwin _setwin
$_cmd $_cmd
exit exit
@ -177,7 +177,8 @@ _ssh() {
[[ -z ${_cmd} ]] && _runxdotool && exit [[ -z ${_cmd} ]] && _runxdotool && exit
_paneid=$($_tmux new-window -P -t ${_sess} -F '#D' ${_cmd}) _paneid=$($_tmux new-window -P -t ${_sess} -F '#D' ${_cmd})
$_setenv ${_paneid} ${_host}
[[ -n ${_host} ]] && $_setenv ${_paneid} ${_host}
_setwin _setwin
_runxdotool _runxdotool
else else