fix: resolve node remarks printed as default prefix upon initial node creation
Main / build (push) Waiting to run

This commit is contained in:
2026-07-08 12:24:13 +08:00
parent 5a102d7306
commit 90a8ad633f
+6 -2
View File
@@ -521,9 +521,10 @@ create() {
[[ $is_config_file ]] && is_no_del_msg=1 && del $is_config_file [[ $is_config_file ]] && is_no_del_msg=1 && del $is_config_file
# save json to file # save json to file
if [[ $is_remarks ]]; then 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 else
cat <<<$is_new_json >$is_json_file echo "$is_new_json" >$is_json_file
fi fi
if [[ ! -f $is_config_json ]]; then if [[ ! -f $is_config_json ]]; then
# config.json # config.json
@@ -1587,11 +1588,14 @@ info() {
local custom_remarks="" local custom_remarks=""
if [[ $is_config_file ]]; then if [[ $is_config_file ]]; then
custom_remarks=$(grep -E '^[[:space:]]*//[[:space:]]*remarks:' $is_conf_dir/"$is_config_file" | sed 's/.*remarks:[[:space:]]*//') 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 fi
local url_remarks="sb-$net-$is_addr" local url_remarks="sb-$net-$is_addr"
[[ $host ]] && url_remarks="sb-$net-$host" [[ $host ]] && url_remarks="sb-$net-$host"
[[ $is_anytls_domain ]] && url_remarks="sb-$net-$is_anytls_domain" [[ $is_anytls_domain ]] && url_remarks="sb-$net-$is_anytls_domain"
[[ $custom_remarks ]] && url_remarks=$custom_remarks [[ $custom_remarks ]] && url_remarks=$custom_remarks
[[ $is_remarks ]] && url_remarks=$is_remarks
# is_color=$(shuf -i 41-45 -n1) # is_color=$(shuf -i 41-45 -n1)
is_color=44 is_color=44