summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2024-03-31 15:56:45 +0000
committerFelix Fietkau2024-03-31 17:39:31 +0000
commitcbbe9d337a17010067b6883fcbad9ed9e994cc36 (patch)
tree34671500f2f8187465442f7b1a3c1477dfbeb258
parenta29d45c71bca9babb24a477ff7f801daa9b3326c (diff)
downloadunetd-cbbe9d337a17010067b6883fcbad9ed9e994cc36.tar.gz
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 <nbd@nbd.name>
-rwxr-xr-xscripts/unet-cli4
1 files 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") {