aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-02-08 20:47:01 +0100
committerMattias Andrée <m@maandree.se>2025-02-08 20:47:01 +0100
commitd4acc4cd8083c232387c3ebb78178c5032e0b06f (patch)
tree857e35fdc3c61d46a9872208002a34c46c7cb3c9
parentAdd environment variables that lets the user override the option classes of ssh (diff)
downloadsshexec-d4acc4cd8083c232387c3ebb78178c5032e0b06f.tar.gz
sshexec-d4acc4cd8083c232387c3ebb78178c5032e0b06f.tar.bz2
sshexec-d4acc4cd8083c232387c3ebb78178c5032e0b06f.tar.xz
Add SSHEXEC_SSH
Signed-off-by: Mattias Andrée <m@maandree.se>
-rw-r--r--README4
-rw-r--r--sshcd.17
-rw-r--r--sshexec.17
-rw-r--r--sshexec.c7
4 files changed, 23 insertions, 2 deletions
diff --git a/README b/README
index 8476cee..25af146 100644
--- a/README
+++ b/README
@@ -158,6 +158,10 @@ ENVIRONMENT VARIABLES
variable affects where the sshexec utility can find the
ssh(1) utility or ssh-command.
+ SSHEXEC_SSH
+ If set and non-empty, it overrides the default value of
+ ssh-command from ssh to the value of the variable.
+
SSHEXEC_OPTS_NO_ARG
List of options that sshexec shall interpret as ssh(1)
options that do not have any argument. (Default is
diff --git a/sshcd.1 b/sshcd.1
index 7b5ede4..d2a0265 100644
--- a/sshcd.1
+++ b/sshcd.1
@@ -140,6 +140,13 @@ to tell SSH to allocate a pseudo terminal. If unset
will be used. If set but empty, no flag will be passed to
.BR ssh (1).
.TP
+.I SSHEXEC_SSH
+If set and non-empty, it overrides the default value of
+.I ssh-command
+from
+.B ssh
+to the value of the variable.
+.TP
.I SSHEXEC_OPTS_NO_ARG
List of options that
.B sshexec
diff --git a/sshexec.1 b/sshexec.1
index 9f37962..dc42392 100644
--- a/sshexec.1
+++ b/sshexec.1
@@ -296,6 +296,13 @@ utility can find the
utility or
.IR ssh-command .
.TP
+.I SSHEXEC_SSH
+If set and non-empty, it overrides the default value of
+.I ssh-command
+from
+.B ssh
+to the value of the variable.
+.TP
.I SSHEXEC_OPTS_NO_ARG
List of options that
.B sshexec
diff --git a/sshexec.c b/sshexec.c
index 7ed551a..bc02987 100644
--- a/sshexec.c
+++ b/sshexec.c
@@ -480,8 +480,11 @@ parse_sshexec_options(char *argv[])
end_of_options:
/* Parse options and set defaults */
- if (!ssh)
- ssh = "ssh";
+ if (!ssh) {
+ ssh = get("SSHEXEC_SSH", "");
+ if (!*ssh)
+ ssh = "ssh";
+ }
if (!cd)
strict_cd = !is_sshcd;