mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-07-01 21:00:29 +08:00
feat: remove frigg-client.log
This commit is contained in:
parent
86088ecfb1
commit
70090242be
@ -39,8 +39,7 @@ case $DFS_UPDATE_CHANNEL in
|
||||
esac
|
||||
if [[ ${#DFS_COMMIT} != 40 ]]; then
|
||||
fmt_error "invalid commit id"
|
||||
apost_beacon "dfs.invalid-commit"
|
||||
apost_log "ERROR" "$THIS_FILE" "invalid commit id: ${DFS_COMMIT}"
|
||||
apost_beacon "dfs.invalid-commit" "invalid commit id: ${DFS_COMMIT}"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
1
.zshrc2
1
.zshrc2
@ -187,7 +187,6 @@ dfs()
|
||||
"$DOTFILES/install.sh" -i
|
||||
echo 'Done. Please open a new shell to see the changes.'
|
||||
;;
|
||||
log ) "$DOTFILES/tools/common.sh" "post_log" "INFO" "dfs" "$2" ;;
|
||||
beacon ) "$DOTFILES/tools/common.sh" "post_beacon" "$2" "$3" ;;
|
||||
* ) echo "unknown command \"$1\". available: update, force-update, version, reset, cd, log" ;;
|
||||
esac
|
||||
|
@ -162,19 +162,6 @@ ask_for_Yn()
|
||||
fi
|
||||
}
|
||||
|
||||
post_log()
|
||||
{
|
||||
if [[ $# != 3 || -z "$1" || -z "$2" || -z "$3" ]]; then
|
||||
fmt_fatal "usage: post_log <level> <section> <content>"
|
||||
fi
|
||||
"${DOTFILES}/tools/frigg-client.sh" "log" "[$1][$2] $3"
|
||||
}
|
||||
|
||||
apost_log()
|
||||
{
|
||||
post_log "$@" 1>/dev/null &
|
||||
}
|
||||
|
||||
post_beacon()
|
||||
{
|
||||
if [[ $# < 1 || -z "$1" ]]; then
|
||||
|
@ -63,8 +63,8 @@ handle_resp()
|
||||
|
||||
post_beacon()
|
||||
{
|
||||
local beacon_type=$1
|
||||
local meta=$2
|
||||
local beacon_type="$1"
|
||||
local meta="$2"
|
||||
if [[ -n "$CI" && "$beacon_type" != "gh.ci" && "$beacon_type" != "dfs.invalid-commit" && "$beacon_type" != "dfs.dirty" ]]; then
|
||||
return
|
||||
fi
|
||||
@ -75,17 +75,6 @@ post_beacon()
|
||||
handle_resp "$resp"
|
||||
}
|
||||
|
||||
post_log()
|
||||
{
|
||||
local log_content=$1
|
||||
if [[ -z "$log_content" ]]; then
|
||||
fmt_fatal "log content is required"
|
||||
fi
|
||||
init_uuid
|
||||
resp=$(curl $DFS_CURL_OPTIONS -sSL -X POST -H "Content-Type: text/plain" -d "$log_content" "https://api.beardic.cn/post-log?hostname=$hostname&uuid=$uuid")
|
||||
handle_resp "$resp"
|
||||
}
|
||||
|
||||
update_dns()
|
||||
{
|
||||
if [[ -z "$DFS_DDNS_IP4$DFS_DDNS_IP6" ]]; then
|
||||
@ -138,7 +127,7 @@ update_dns()
|
||||
|
||||
print_help()
|
||||
{
|
||||
fmt_info "usage: $0 <beacon|log|ddns> [beacon_type|log_content]"
|
||||
fmt_info "usage: $0 <beacon|ddns> [beacon_type] [beacon_meta]"
|
||||
}
|
||||
|
||||
router()
|
||||
@ -150,9 +139,6 @@ router()
|
||||
beacon)
|
||||
post_beacon "$2" "$3"
|
||||
;;
|
||||
log)
|
||||
post_log "$2"
|
||||
;;
|
||||
ddns)
|
||||
update_dns
|
||||
;;
|
||||
|
@ -27,7 +27,6 @@ fi
|
||||
|
||||
# check scripts and functions
|
||||
dfs version
|
||||
dfs log 1
|
||||
dfs beacon gh.ci $GITHUB_SHA
|
||||
z ~
|
||||
test ~ -ef "$(pwd)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user