mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-11-23 20:38:16 +08:00
[dev] ddns; better ssh agent; riot sshl; sys.online; zsh hist import; DFS_DEBUG; cbd/cbds (#36)
* riot: bj1 -> proxy * ci: test ask_for_yn * --wip-- [skip ci] * install.sh: will prompt version * zshrc: piv-agent now can re-use agents * zshrc: in docker use theme robbyrussell * update.sh: will send online beacon * beacon: support meta with limited len 64 * bug fix (Sat Jan 21 16:45:35 CST 2023) * well, finally add ssh key for ltp1-bd * set DFS_INITED and do not send login beacon if it was set * rewrite piv-agent to sagent; fmt_note and fmt_into will write to stderr * bug fix (Mon Jan 30 19:41:00 CST 2023) * bug fix (Mon Jan 30 19:46:27 CST 2023) * login beacon add details * $DFS_ORPHAN turns logger off * disable more beacons in CI * install.sh: prepare config earlier * init pbin * install.sh: -H|--hist|--history * install.sh: -H hint * install.sh: -H support multiple keys * fix zsh hist with no new line at the end * remove ^M in hist * bug fix (Wed Feb 1 21:11:41 CST 2023) * bug fix (Wed Feb 1 21:16:29 CST 2023) * bug fix (Wed Feb 1 21:20:21 CST 2023) * ci will send gh.ci.fail * show install opts * DFS_DEBUG to set -x * bug fix: install.sh re-start itself with no args incorrectly * bug fix (Thu Feb 2 18:43:16 CST 2023) * riot: ob->ebd, swap option $1 and $2 and $2 is default to ssh * riot: introduce sshl * logger.sh: support ddns * bug fix (Wed Mar 1 16:37:42 CST 2023) * dfs.ddns.failed -> dfs.ddns.fail * login beacon 2>/dev/null * logger.sh -> frigg-client.sh; curl add time limit 10s * to-install.sh: improve docker-ce * use $DFS_CURL_OPTIONS * ci: add ddns * bug fix (Wed Mar 15 19:37:21 CST 2023) * Revert "bug fix (Wed Mar 15 19:37:21 CST 2023)" This reverts commit2df87ce1a8. * Revert "ci: add ddns" This reverts commit4fe8321504. * alias cbd and cbds, riot nasp port to 12022 * .zshrc: sagent -> sagt * fix ci * riot: bug fix when 'tmp' has leading zeros * add ci for cbds --------- Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
This commit is contained in:
@@ -3,8 +3,11 @@ set -e
|
||||
THIS_DIR_COMMON_SH=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
export DOTFILES=$( cd "$THIS_DIR_COMMON_SH/.." && pwd )
|
||||
if [[ -f ~/.config/dotfiles/env ]]; then set -a; source ~/.config/dotfiles/env; set +a; fi
|
||||
if [[ "$DFS_DEBUG" == "1" ]]; then set -x; fi
|
||||
DFS_CURL_OPTIONS="--retry 2 --max-time 20"
|
||||
|
||||
# parse args and set env, when it is sourced
|
||||
# todo: make this skipable
|
||||
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
|
||||
ORIGIN_ARGS=("$@")
|
||||
ARG=""
|
||||
@@ -29,7 +32,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
|
||||
done
|
||||
set -- "${ORIGIN_ARGS[@]}"
|
||||
unset ARG
|
||||
unset ORIGIN_ARGS
|
||||
# outputs: GOT_OPTS and ORIGIN_ARGS
|
||||
fi
|
||||
|
||||
# Color settings
|
||||
@@ -74,11 +77,11 @@ fmt_warning() {
|
||||
}
|
||||
|
||||
fmt_info() {
|
||||
printf '%sinfo: %s\n' "${FMT_RESET}" "$*" >&1
|
||||
printf '%sinfo: %s\n' "${FMT_RESET}" "$*" >&2
|
||||
}
|
||||
|
||||
fmt_note() {
|
||||
printf '%s%s%s\n' "${FMT_GREEN}" "$*" "${FMT_RESET}" >&1
|
||||
printf '%s%s%s\n' "${FMT_GREEN}" "$*" "${FMT_RESET}" >&2
|
||||
}
|
||||
|
||||
setup_color() {
|
||||
@@ -163,7 +166,7 @@ post_log()
|
||||
if [[ $# != 3 || -z "$1" || -z "$2" || -z "$3" ]]; then
|
||||
fmt_fatal "usage: post_log <level> <section> <content>"
|
||||
fi
|
||||
"${DOTFILES}/tools/logger.sh" "log" "[$1][$2] $3"
|
||||
"${DOTFILES}/tools/frigg-client.sh" "log" "[$1][$2] $3"
|
||||
}
|
||||
|
||||
apost_log()
|
||||
@@ -173,10 +176,10 @@ apost_log()
|
||||
|
||||
post_beacon()
|
||||
{
|
||||
if [[ $# != 1 || -z "$1" ]]; then
|
||||
if [[ $# < 1 || -z "$1" ]]; then
|
||||
fmt_fatal "usage: post_beacon <beacon>"
|
||||
fi
|
||||
"${DOTFILES}/tools/logger.sh" "beacon" "$1"
|
||||
"${DOTFILES}/tools/frigg-client.sh" "beacon" "$1" "$2"
|
||||
}
|
||||
|
||||
apost_beacon()
|
||||
|
||||
Reference in New Issue
Block a user