mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-11-23 04:18:16 +08:00
[dev] refactor riot; use command; remove log; sagt op (#45)
* feat(riot-config): default port 12022 * fix(ci) * feat(riot-config): remove tailing dot from .domain; remove j.remote and x.domain * feat(riot): *.batch * feat(riot): run command in tmux window(s) note that spaces in ssh commands are still not supported * feat(riot): -o RequestTTY=yes * fix(riot): SSH_OPTIONS * fix(riot): tmux use bash * feat(zshrc): use() * fix(riot): scp, and ci note that riot still has problems with spaces. we should use array to handle parameters. * fix(ci): update macos image * feat: update email * feat: revert git email * feat(ssh): update keys * feat(sagent): sagt op * fix(sagent): error note * fix(ci): test of auto-dep * feat(ssh): remove keys ltp1-bd and ltp1 * feat(riot): rm - remove host keys * build(ci): update to ubuntu-latest and Yikun/hub-mirror-action@v1.5 * feat: remove frigg-client.log * feat(riot): -t or --trust to set RIOT_TRUST_SERVER * feat(zshrc/alias): add sc and t, remove cps and mvs feat(zshrc/plugins): add man and web-search, remove ufw * feat(riot): refactor argparse feat(riot): add `--password` and `--` feat(common.sh): argparse supports `--` feat(riot): refactor ping to ping remote * feat(riot): sshd can specify the local port * feat(riot): print help when no argument or no remote * fix(riot): ci * feat(riot): better print_cmd with escape * feat(riot-config): support sed* * fix(frigg): hostname converted into lower case
This commit is contained in:
@@ -1,13 +1,29 @@
|
||||
#!/bin/false
|
||||
|
||||
# remotes
|
||||
j.remote() {
|
||||
remote=ssh.beardic.cn
|
||||
RET_PORT=${RET_PORT:-24022}
|
||||
RET_USERNAME=${RET_USERNAME:-root}
|
||||
RET_TRUST_SERVER=1
|
||||
# batches
|
||||
nasps.batch() {
|
||||
remotes+=(
|
||||
g1.nasp
|
||||
g2.nasp
|
||||
g3.nasp
|
||||
g4.nasp
|
||||
g5.nasp
|
||||
g6.nasp
|
||||
g7.nasp
|
||||
g8.nasp
|
||||
g9.nasp
|
||||
g10.nasp
|
||||
g11.nasp
|
||||
g12.nasp
|
||||
g13.nasp
|
||||
g14.nasp
|
||||
dictxiong@g15.nasp
|
||||
dictxiong@g16.nasp
|
||||
g17.nasp
|
||||
)
|
||||
}
|
||||
|
||||
# remotes
|
||||
nasp.remote() {
|
||||
remote=nasp.fit
|
||||
RET_PORT=${RET_PORT:-36022}
|
||||
@@ -18,17 +34,16 @@ nasp.remote() {
|
||||
# domains
|
||||
.domain() {
|
||||
RET_USERNAME=${RET_USERNAME:-root}
|
||||
RET_PORT=${RET_PORT:-12022}
|
||||
RET_HOSTNAME=${remote%.}
|
||||
}
|
||||
|
||||
dxng.domain() {
|
||||
RET_HOSTNAME=$host.dxng.net
|
||||
RET_PORT=${RET_PORT:-12022}
|
||||
RET_USERNAME=${RET_USERNAME:-root}
|
||||
RET_TRUST_SERVER=1
|
||||
}
|
||||
|
||||
i.domain() {
|
||||
RET_HOSTNAME=$host.ibd.ink
|
||||
if [[ "$host" =~ ^sed([0-9]{1,2})$ ]]; then
|
||||
RET_HOSTNAME=192.168.98.$((100+BASH_REMATCH[1]))
|
||||
else
|
||||
RET_HOSTNAME=$host.dxng.net
|
||||
fi
|
||||
RET_PORT=${RET_PORT:-12022}
|
||||
RET_USERNAME=${RET_USERNAME:-root}
|
||||
RET_TRUST_SERVER=1
|
||||
@@ -41,15 +56,6 @@ i.domain() {
|
||||
RET_TRUST_SERVER=1
|
||||
}
|
||||
|
||||
x.domain() {
|
||||
RET_HOSTNAME=ssh.beardic.cn
|
||||
local tmp=$(sha256sum <<< "$host" | tr -cd "[:digit:]")
|
||||
tmp=${tmp:0:4}
|
||||
RET_PORT=$((10#$tmp+36000))
|
||||
RET_USERNAME=root
|
||||
RET_TRUST_SERVER=1
|
||||
}
|
||||
|
||||
nasp.domain() {
|
||||
RET_HOSTNAME=$host
|
||||
RET_PORT=${RET_PORT:-12022}
|
||||
|
||||
Reference in New Issue
Block a user