dotfiles/riot-config.sh
Dict Xiong 891bbcacff
[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
2025-06-24 19:56:04 +08:00

70 lines
1.2 KiB
Bash

#!/bin/false
# 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}
RET_USERNAME=${RET_USERNAME:-root}
RET_TRUST_SERVER=1
}
# domains
.domain() {
RET_USERNAME=${RET_USERNAME:-root}
RET_PORT=${RET_PORT:-12022}
RET_HOSTNAME=${remote%.}
}
dxng.domain() {
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
}
42.domain() {
RET_HOSTNAME=$host.i.bd.dn42
RET_PORT=${RET_PORT:-12022}
RET_USERNAME=${RET_USERNAME:-root}
RET_TRUST_SERVER=1
}
nasp.domain() {
RET_HOSTNAME=$host
RET_PORT=${RET_PORT:-12022}
RET_USERNAME=${RET_USERNAME:-root}
RET_JUMP_SERVER="ssh@nasp.fit:36022"
RET_TRUST_SERVER=1
}
default.domain() {
dxng.domain
}