2022-11-05 19:45:21 +08:00
|
|
|
#!/bin/false "This script should be sourced in zsh, not executed directly"
|
2022-08-28 20:51:44 +08:00
|
|
|
|
|
|
|
set -ex
|
2023-04-21 12:37:05 +08:00
|
|
|
trap "dfs beacon gh.ci.fail" ERR
|
2022-08-28 20:51:44 +08:00
|
|
|
|
2023-11-06 19:13:22 +08:00
|
|
|
# fix for macos
|
|
|
|
dfs cd
|
|
|
|
if [[ $(./tools/common.sh get_os_type) == "macos" ]]; then
|
|
|
|
export PATH="/usr/local/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/coreutils/libexec/gnubin:${PATH}"
|
|
|
|
fi
|
|
|
|
|
2022-08-28 20:51:44 +08:00
|
|
|
# check files
|
|
|
|
cd /
|
2022-11-05 19:45:21 +08:00
|
|
|
l
|
|
|
|
cd ~
|
|
|
|
l
|
2022-08-28 20:51:44 +08:00
|
|
|
dfs cd
|
2022-11-05 19:45:21 +08:00
|
|
|
l
|
2022-08-28 20:51:44 +08:00
|
|
|
pwd
|
|
|
|
test -f .zshrc2
|
|
|
|
diff -q ./.ssh/authorized_keys2 ~/.ssh/authorized_keys2
|
2023-11-06 19:13:22 +08:00
|
|
|
diff -q ./.eid/authorized_certificates ~/.eid/authorized_certificates
|
2022-08-28 20:51:44 +08:00
|
|
|
grep -q ".zshrc2" ~/.zshrc
|
[dev] refactor riot; improve tmux and vim; more plugins; more aliases (#43)
* riot: remove unknown domain warn
* install.sh: --no-ssh -> --no-auth-info
* doll: --restart=unless-stopped
* zshrc: alias cps and mvs
* riot: proxy -> ssh
* zshrc: not alias rm to trash
* (trial) riot devel: separate preset to config dir riot.d
* riot: support extra options and extra -o options
* (experimental) riot config in a single file
* riot config: add nasp remote and null domain
* gitconf: pull.ff = only
* fix ci
* riot: dynamic port forwarding
* riot: only one domain func will be exec
* to-install: update lemonbench
* to-install: alist
* [exp] riot inferred ssh: ping ping6
* sagt: fix nixos
* riot config: domain 42
* ubuntu.sh: DEBIAN_FRONTEND=noninteractive
* zshrc: ping -n
* zshrc: alias ping -n
* riot-config: jumpserver from sir0 to ssh.beardic.cn
* zshrc: alias ping before checking os type
* frigg: support api4.beardic.cn
* fix(install.sh): crontab fails on a new server
* fix(riot-conf): nasp.ob.ac.cn -> nasp.fit
* fix(install.sh): install crontab (exp)
* feat(test.zsh): test crontab
* fix(riot): secure control master
* fix(ci): riot control master
* fix(riot): not mkdir if dry-run
* feat(vimrc): set shiftwidth=4
* feat(ci): sync tmux-yank
* feat(tmux): set-clipboard on and mouse on (experimental)
* feat(zshrc): alias ping6
* build(ci): hub mirror 1.3->1.4
* fix(zshrc): tmux on msys; feat(common): better perf getting os type and linux dist
* fix(common.sh): get_os_type and get_linux_dist
* feat(zshrc): add plugin {magic-enter,per-directory-history,pip,podman,python,rsync,systemd,timer}
* feat(zshrc): journalctl alias
* feat(vimrc): tab=2 for c,cpp,nix,yaml
* build(ci): checkout v3 -> v4
---------
Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2024-05-05 12:02:55 +08:00
|
|
|
if [[ -x $(command -v crontab) ]]; then
|
|
|
|
crontab -l | grep -qxF "0 * * * * ${DOTFILES}/update.sh"
|
|
|
|
fi
|
2022-08-28 20:51:44 +08:00
|
|
|
|
|
|
|
# check scripts and functions
|
|
|
|
dfs version
|
|
|
|
dfs log 1
|
2023-04-21 12:37:05 +08:00
|
|
|
dfs beacon gh.ci $GITHUB_SHA
|
2022-11-05 19:45:21 +08:00
|
|
|
z ~
|
|
|
|
test ~ -ef "$(pwd)"
|
2022-08-28 20:51:44 +08:00
|
|
|
dogo
|
2022-11-14 01:37:48 +08:00
|
|
|
doll
|
2022-11-05 19:45:21 +08:00
|
|
|
dfs cd
|
2023-04-21 12:37:05 +08:00
|
|
|
tools/test-getopts.sh
|
|
|
|
tools/common.sh get_os_name
|
|
|
|
test $(echo y | tools/common.sh ask_for_yN "test") = "1"
|
|
|
|
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") = "1"
|
|
|
|
test $(DFS_QUIET=1 tools/common.sh ask_for_Yn "test") = "1"
|
[dev] refactor riot; improve tmux and vim; more plugins; more aliases (#43)
* riot: remove unknown domain warn
* install.sh: --no-ssh -> --no-auth-info
* doll: --restart=unless-stopped
* zshrc: alias cps and mvs
* riot: proxy -> ssh
* zshrc: not alias rm to trash
* (trial) riot devel: separate preset to config dir riot.d
* riot: support extra options and extra -o options
* (experimental) riot config in a single file
* riot config: add nasp remote and null domain
* gitconf: pull.ff = only
* fix ci
* riot: dynamic port forwarding
* riot: only one domain func will be exec
* to-install: update lemonbench
* to-install: alist
* [exp] riot inferred ssh: ping ping6
* sagt: fix nixos
* riot config: domain 42
* ubuntu.sh: DEBIAN_FRONTEND=noninteractive
* zshrc: ping -n
* zshrc: alias ping -n
* riot-config: jumpserver from sir0 to ssh.beardic.cn
* zshrc: alias ping before checking os type
* frigg: support api4.beardic.cn
* fix(install.sh): crontab fails on a new server
* fix(riot-conf): nasp.ob.ac.cn -> nasp.fit
* fix(install.sh): install crontab (exp)
* feat(test.zsh): test crontab
* fix(riot): secure control master
* fix(ci): riot control master
* fix(riot): not mkdir if dry-run
* feat(vimrc): set shiftwidth=4
* feat(ci): sync tmux-yank
* feat(tmux): set-clipboard on and mouse on (experimental)
* feat(zshrc): alias ping6
* build(ci): hub mirror 1.3->1.4
* fix(zshrc): tmux on msys; feat(common): better perf getting os type and linux dist
* fix(common.sh): get_os_type and get_linux_dist
* feat(zshrc): add plugin {magic-enter,per-directory-history,pip,podman,python,rsync,systemd,timer}
* feat(zshrc): journalctl alias
* feat(vimrc): tab=2 for c,cpp,nix,yaml
* build(ci): checkout v3 -> v4
---------
Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2024-05-05 12:02:55 +08:00
|
|
|
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 PermitLocalCommand=yes -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C -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 PermitLocalCommand=yes -o ControlMaster=auto -o ControlPath=~/.ssh/master-socket/%C -o ForwardX11=yes -o ForwardAgent=yes -r another@host.ibd.ink:"/tmp/" "./tmp"'
|
2022-08-28 20:51:44 +08:00
|
|
|
|
|
|
|
# check alias
|
2022-11-15 01:28:38 +08:00
|
|
|
alias p114
|
2023-04-21 12:37:05 +08:00
|
|
|
alias cbds
|
2023-01-06 16:14:41 +08:00
|
|
|
which riot
|
2023-04-21 12:37:05 +08:00
|
|
|
sagt
|
2024-08-28 09:59:07 +08:00
|
|
|
test -f ~/.ssh/agent-$(whoami)
|
2022-11-17 20:02:35 +08:00
|
|
|
gbes || which gbes
|
2022-08-28 20:51:44 +08:00
|
|
|
|
|
|
|
# check update
|
2022-11-05 19:45:21 +08:00
|
|
|
DFS_VERSION=`dfs version`
|
2022-08-28 20:51:44 +08:00
|
|
|
dfs update
|
|
|
|
dfs version
|
|
|
|
test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`
|
2022-11-05 19:45:21 +08:00
|
|
|
|
|
|
|
# clean
|
|
|
|
git reset --hard $DFS_VERSION
|
2022-11-12 20:05:29 +08:00
|
|
|
|
|
|
|
# then check install.sh
|
2023-04-21 12:37:05 +08:00
|
|
|
./install.sh -dx DFS_CI=1 -H e153a2eL,f8At3iFw
|
|
|
|
grep -qE "testhist 1$" ~/.zsh_history
|
|
|
|
grep -qE "testhist 4$" ~/.zsh_history
|
|
|
|
grep -qx "DFS_CI=1" ~/.config/dotfiles/env
|
|
|
|
./install.sh -l
|
2022-11-12 20:05:29 +08:00
|
|
|
dfs version
|
|
|
|
test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`
|
|
|
|
|
|
|
|
# clean
|
|
|
|
git reset --hard $DFS_VERSION
|
|
|
|
|
2023-04-21 12:37:05 +08:00
|
|
|
set +x
|