From cbbe9d337a17010067b6883fcbad9ed9e994cc36 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 31 Mar 2024 17:56:45 +0200 Subject: [PATCH] unet-cli: emit id by default Use the public auth key as id. This provides more entropy for the network id Signed-off-by: Felix Fietkau --- scripts/unet-cli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/unet-cli b/scripts/unet-cli index 6dbf060..3191e91 100755 --- a/scripts/unet-cli +++ b/scripts/unet-cli @@ -1,8 +1,7 @@ #!/usr/bin/env ucode - 'use strict'; -import { access, basename, dirname, mkstemp, open, writefile } from 'fs'; +import { access, basename, dirname, mkstemp, open, writefile, popen } from 'fs'; function assert(cond, message) { if (!cond) { @@ -355,6 +354,7 @@ if (command == "create") { args[key] ??= `${val}`; if (!access(`${file}.key`)) system(`${unet_tool} -G > ${file}.key`); + net_data.config.id = trim(popen(`unet-tool -P -K ${file}.key`).read("all")); } if (command == "sign") { -- 2.30.2