mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-01-10 04:27:48 +08:00
feat(riot): conditionally RequestTTY
This commit is contained in:
parent
bdef3b52d1
commit
d283671f25
@ -93,7 +93,10 @@ parse_remote() {
|
|||||||
TRUST_SERVER=1
|
TRUST_SERVER=1
|
||||||
PORT="" # optional
|
PORT="" # optional
|
||||||
USERNAME="" # optional
|
USERNAME="" # optional
|
||||||
SSH_OPTIONS=("-o" "RequestTTY=yes" "-o" "ServerAliveInterval=60")
|
SSH_OPTIONS=("-o" "ServerAliveInterval=60")
|
||||||
|
if [[ -t 1 ]]; then
|
||||||
|
SSH_OPTIONS+=("-o" "RequestTTY=yes")
|
||||||
|
fi
|
||||||
if [[ "$RIOT_TRUST_CLIENT" == "1" ]]; then
|
if [[ "$RIOT_TRUST_CLIENT" == "1" ]]; then
|
||||||
SSH_OPTIONS+=("-o" "PermitLocalCommand=yes")
|
SSH_OPTIONS+=("-o" "PermitLocalCommand=yes")
|
||||||
if [[ "$(get_os_type)" != "msys" ]]; then
|
if [[ "$(get_os_type)" != "msys" ]]; then
|
||||||
|
|||||||
@ -40,9 +40,9 @@ test $(echo n | tools/common.sh ask_for_yN "test") = "0"
|
|||||||
test $(echo | tools/common.sh ask_for_yN "test") = "0"
|
test $(echo | tools/common.sh ask_for_yN "test") = "0"
|
||||||
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
|
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
|
||||||
test $(DFS_QUIET=1 tools/common.sh ask_for_Yn "test") = "1"
|
test $(DFS_QUIET=1 tools/common.sh ask_for_Yn "test") = "1"
|
||||||
test "$(DFS_TRUST=1 riot time@is.impt:2222/yes@you-r.right/you@are.really.recht./ibd./try@it,another@host scp /tmp/ ./tmp -D 2>/dev/null)" = 'scp -P 12022 -o RequestTTY=yes -o PermitLocalCommand=yes -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C -o ProxyJump=time@is.impt:2222,yes@you-r.right:12022,you@are.really.recht:12022,root@ibd:12022 -r try@it.dxng.net:/tmp/ ./tmp
|
test "$(DFS_TRUST=1 riot time@is.impt:2222/yes@you-r.right/you@are.really.recht./ibd./try@it,another@host scp /tmp/ ./tmp -D 2>/dev/null)" = 'scp -P 12022 -o ServerAliveInterval=60 -o PermitLocalCommand=yes -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C -o ProxyJump=time@is.impt:2222,yes@you-r.right:12022,you@are.really.recht:12022,root@ibd:12022 -r try@it.dxng.net:/tmp/ ./tmp
|
||||||
scp -P 12022 -o RequestTTY=yes -o PermitLocalCommand=yes -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C -o ForwardX11=yes -o ForwardAgent=yes -r another@host.dxng.net:/tmp/ ./tmp'
|
scp -P 12022 -o ServerAliveInterval=60 -o PermitLocalCommand=yes -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C -o ForwardX11=yes -o ForwardAgent=yes -r another@host.dxng.net:/tmp/ ./tmp'
|
||||||
test "$(riot you@example.com:55 -tD ssh --password -- ping -c 1 2>/dev/null)" = 'ssh -p 55 -o RequestTTY=yes -o ForwardX11=yes -o ForwardAgent=yes -o PasswordAuthentication=yes -o PubkeyAuthentication=no you@example.com ping -c 1'
|
test "$(riot you@example.com:55 -tD ssh --password -- ping -c 1 2>/dev/null)" = 'ssh -p 55 -o ServerAliveInterval=60 -o ForwardX11=yes -o ForwardAgent=yes -o PasswordAuthentication=yes -o PubkeyAuthentication=no you@example.com ping -c 1'
|
||||||
|
|
||||||
# check alias
|
# check alias
|
||||||
alias p114
|
alias p114
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user