mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 11:27:00 +08:00
Compare commits
4 Commits
79d376265e
...
35c302a445
Author | SHA1 | Date | |
---|---|---|---|
|
35c302a445 | ||
|
ce657c8300 | ||
|
c1d555393a | ||
|
b1272e22bb |
|
@ -9,6 +9,8 @@
|
||||||
quotepath = false # chinese chars
|
quotepath = false # chinese chars
|
||||||
[push]
|
[push]
|
||||||
autoSetupRemote = true
|
autoSetupRemote = true
|
||||||
|
[pull]
|
||||||
|
ff = only
|
||||||
[branch]
|
[branch]
|
||||||
# Show most recently changed branches first.
|
# Show most recently changed branches first.
|
||||||
sort = -committerdate
|
sort = -committerdate
|
||||||
|
|
|
@ -8,7 +8,18 @@ j.remote() {
|
||||||
RET_TRUST_SERVER=1
|
RET_TRUST_SERVER=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nasp.remote() {
|
||||||
|
remote=nasp.ob.ac.cn
|
||||||
|
RET_PORT=${RET_PORT:-36022}
|
||||||
|
RET_USERNAME=${RET_USERNAME:-ssh}
|
||||||
|
RET_TRUST_SERVER=1
|
||||||
|
}
|
||||||
|
|
||||||
# domains
|
# domains
|
||||||
|
.domain() {
|
||||||
|
RET_USERNAME=${RET_USERNAME:-root}
|
||||||
|
}
|
||||||
|
|
||||||
i.domain() {
|
i.domain() {
|
||||||
RET_HOSTNAME=$host.ibd.ink
|
RET_HOSTNAME=$host.ibd.ink
|
||||||
RET_PORT=${RET_PORT:-12022}
|
RET_PORT=${RET_PORT:-12022}
|
||||||
|
|
15
scripts/riot
15
scripts/riot
|
@ -163,6 +163,18 @@ run_sshl()
|
||||||
eval_or_echo $cmd
|
eval_or_echo $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# sshd
|
||||||
|
run_sshd()
|
||||||
|
{
|
||||||
|
local port=$(get_free_port)
|
||||||
|
|
||||||
|
SSH_OPTIONS="$SSH_OPTIONS -NC -D $port"
|
||||||
|
local cmd="$(prepare_ssh_cmd ssh)"
|
||||||
|
fmt_note "-->" $cmd
|
||||||
|
fmt_note " > please access localhost:$port"
|
||||||
|
eval_or_echo $cmd
|
||||||
|
}
|
||||||
|
|
||||||
# scp
|
# scp
|
||||||
run_scp() {
|
run_scp() {
|
||||||
local src="$1"
|
local src="$1"
|
||||||
|
@ -228,6 +240,9 @@ router() {
|
||||||
test -n "$3" || fmt_fatal "no target address provided"
|
test -n "$3" || fmt_fatal "no target address provided"
|
||||||
run_sshl "$3"
|
run_sshl "$3"
|
||||||
;;
|
;;
|
||||||
|
sshd )
|
||||||
|
run_sshd
|
||||||
|
;;
|
||||||
scp )
|
scp )
|
||||||
test -n "$3" || fmt_fatal "no source path specified"
|
test -n "$3" || fmt_fatal "no source path specified"
|
||||||
test -n "$4" || fmt_fatal "no destination path specified"
|
test -n "$4" || fmt_fatal "no destination path specified"
|
||||||
|
|
|
@ -38,7 +38,7 @@ 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 ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ProxyJump=time@is.impt:2222,yes@you-r.right,you@are.really.recht.,ibd. -r try@it.ibd.ink:"/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 ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ProxyJump=time@is.impt:2222,yes@you-r.right,you@are.really.recht.,root@ibd. -r try@it.ibd.ink:"/tmp/" "./tmp"
|
||||||
scp -P 12022 -o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ForwardX11=yes -o ForwardAgent=yes -r another@host.ibd.ink:"/tmp/" "./tmp"'
|
scp -P 12022 -o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ForwardX11=yes -o ForwardAgent=yes -r another@host.ibd.ink:"/tmp/" "./tmp"'
|
||||||
|
|
||||||
# check alias
|
# check alias
|
||||||
|
|
Loading…
Reference in New Issue
Block a user