GUI: status accuracy + remove-only action; sync script peer names on exists

This commit is contained in:
Ruslan
2026-04-14 12:47:31 +03:00
parent 54868b99cd
commit 8e124be1f0
4 changed files with 9 additions and 11 deletions

View File

@@ -257,7 +257,13 @@ cmd_add() {
if peer_exists_by_pubkey "$client_pubkey"; then
local existing_addr
local existing_allowed
existing_addr="$(extract_peer_address_by_pubkey "$client_pubkey")"
existing_allowed="${existing_addr:-}"
if [[ -n "$client_routes" ]]; then
existing_allowed="${existing_allowed},${client_routes}"
fi
sync_gui_db_upsert_peer "$client_name" "$client_pubkey" "${existing_addr:-}" "$client_routes" "$client_psk" "${existing_allowed}" 1
cat <<EOF_OUT
STATUS=exists
CLIENT_NAME=$client_name