From 90a8ad633f3260b2e69e502af162b5f17d56da63 Mon Sep 17 00:00:00 2001 From: svefnz Date: Wed, 8 Jul 2026 12:24:13 +0800 Subject: [PATCH] fix: resolve node remarks printed as default prefix upon initial node creation --- src/core.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core.sh b/src/core.sh index 06cdbc0..284ddbc 100644 --- a/src/core.sh +++ b/src/core.sh @@ -521,9 +521,10 @@ create() { [[ $is_config_file ]] && is_no_del_msg=1 && del $is_config_file # save json to file if [[ $is_remarks ]]; then - echo -e "// remarks: $is_remarks\n$(cat <<<$is_new_json)" >$is_json_file + echo "// remarks: $is_remarks" >$is_json_file + echo "$is_new_json" >>$is_json_file else - cat <<<$is_new_json >$is_json_file + echo "$is_new_json" >$is_json_file fi if [[ ! -f $is_config_json ]]; then # config.json @@ -1587,11 +1588,14 @@ info() { local custom_remarks="" if [[ $is_config_file ]]; then custom_remarks=$(grep -E '^[[:space:]]*//[[:space:]]*remarks:' $is_conf_dir/"$is_config_file" | sed 's/.*remarks:[[:space:]]*//') + elif [[ -f $is_json_file ]]; then + custom_remarks=$(grep -E '^[[:space:]]*//[[:space:]]*remarks:' $is_json_file | sed 's/.*remarks:[[:space:]]*//') fi local url_remarks="sb-$net-$is_addr" [[ $host ]] && url_remarks="sb-$net-$host" [[ $is_anytls_domain ]] && url_remarks="sb-$net-$is_anytls_domain" [[ $custom_remarks ]] && url_remarks=$custom_remarks + [[ $is_remarks ]] && url_remarks=$is_remarks # is_color=$(shuf -i 41-45 -n1) is_color=44