return `-K ${file}.key`;
}
-function sync_ssh_host(host) {
+function sync_ssh_host(host, net_data) {
let interface = args.interface ?? "unet";
let connect = replace(args.connect ?? "", ",", " ");
- let auth_key = args.auth_key;
+ let auth_key = args.auth_key ?? net_data.config.id;
let tunnels = replace(replace(args.tunnels ?? "", ",", " "), ":", "=");
let domain = args.domain ?? "unet";
let dht;
fetch_args();
-if (command in [ "add-ssh-host", "set-ssh-host" ]) {
- sync_ssh_host(ssh_host);
- command = replace(command, "ssh-", "");
-}
-
let net_data;
if (command == "import") {
}
}
+if (command in [ "add-ssh-host", "set-ssh-host" ]) {
+ sync_ssh_host(ssh_host, net_data);
+ command = replace(command, "ssh-", "");
+}
+
if (command == "sign") {
let ret = system(`${unet_tool} -S ${key_arg(file, net_data)} -o ${file}.bin ${file}`);
if (ret != 0)