Subj : Im trying to create a synchronet service
To   : All
From : Taalmahret
Date : Tue Oct 01 2024 03:34 pm

The services.ini has a service i created to call plink.exe in a file called plink_service.js located in the exec directory.
the section content is as follows:
[PlinkTunnel]
Command = plink_service.js
Enabled = true
Port = 9999
Log = true

My first issue is that non of the log() commands are being received by synchronet.  i dont see any errors.  i see that the port binding message
 10/1  05:18:45p  PlinkTunnel listening on socket 0.0.0.0 port 9999
 10/1  05:18:45p  PlinkTunnel listening on socket :: port 9999

no other messages are displayed.  The service doesnt seem to succeed.  here is the script as i am just needing help on spotting any obvious issues.

// plink_service.js

var username = "user";
var remote_ip = "123.456.789.012";
var keyfile = "path\\to\\folder\\file.ppk";
var local_port = 23;
var remote_port = 23;
var redirect_output = " >plink_output.log 2>&1";

// Build the Plink command
var plink_cmd = 'plink.exe -batch -ssh -i ' + keyfile + ' -R ' + remote_port + ':localhost:' + local_port + ' ' + username + '@' + remote_ip;
var result = system.exec(plink_cmd + redirect_output);

// Log the command to the Synchronet log
log(LOG_INFO,"Running Plink command: " + plink_cmd);
console.print("Running Plink command: " + plink_cmd + "\n");

// Execute the Plink command
var result = system.exec(plink_cmd);

// Check the result of the Plink command execution
if (result === 0) {
   log(LOG_INFO, "Plink tunnel established successfully.");
   console.print("Plink tunnel established successfully.\n");
} else {
   log(LOG_WARNING, "Error establishing Plink tunnel, exit code: " + result);
   console.print("Error establishing Plink tunnel, exit code: " + result);
}

---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net