From 3db962b4aa32c4e25b34caf1828a60464e1e2666 Mon Sep 17 00:00:00 2001 From: Mike Holloway Date: Mon, 7 Apr 2025 21:26:26 -0400 Subject: [PATCH] Working argument string split->list --- icecast-ssl-helper | 2 +- icecast-ssl-helper.scm | 45 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/icecast-ssl-helper b/icecast-ssl-helper index 60dfeae..fbb0045 100755 --- a/icecast-ssl-helper +++ b/icecast-ssl-helper @@ -17,4 +17,4 @@ GUILE_BIN="guile3.0" -$GUILE_BIN -s icecast-ssl-helper.scm +$GUILE_BIN --debug -e main -s icecast-ssl-helper.scm diff --git a/icecast-ssl-helper.scm b/icecast-ssl-helper.scm index 412b542..a3fa446 100644 --- a/icecast-ssl-helper.scm +++ b/icecast-ssl-helper.scm @@ -1,8 +1,43 @@ -(use-modules (ssh session)) +(use-modules (ice-9 getopt-long) + (ice-9 rdelim) + (ssh channel) + (ssh session) + (ssh auth) + (ssh key) + (ssh version)) -(display "Hello there.\n") +(define (print-help-and-exit) + "Print information about program usage." + (display + (string-append + *program-name* " -- A Helper for Icecast SSL over SSH Tunnel +Copyright (C) Equilibrate IT Inc. +Licensed under GNU GPLv3+ -(define (myproc x y) - (string-append "x is " x "\nand y is " y "\n")) +Usage: " *program-name* " [ -upidv ] -(values (myproc "7" "9")) +Options: + --user=, -u User name + --port=, -p Port number + --identity-file=, -i Path to private key + --debug, -d Debug mode + --ssh-debug= Debug libssh + --version, -v Print version +")) + (display "exit\n")) + +(define *program-name* "icecast-ssl-helper") +(define *default-identity-file* + (string-append (getenv "HOME") "/.ssh/id_rsa")) +(define *default-log-verbosity* "nolog") + +(define %accepted-key-types "ssh-rsa,rsa-sha2-256,ssh-dss,ecdh-sha2-nistp256") + +(define debug? #t) + +(define (main args) + (cond ((not (eq? "" args)) + (display (string-split args #\ ))) + (else (display "Tail sequence")))) + +(main "arg1 arg2 arg3")