From 0a79fc285aefb55032658735866195d758c2e3b2 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Thu, 1 Sep 2022 08:46:13 +0200 Subject: [PATCH] start: forward command line args to the shell --- utils/bin/start | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/utils/bin/start b/utils/bin/start index f074c15..39f956b 100644 --- a/utils/bin/start +++ b/utils/bin/start @@ -25,10 +25,15 @@ while getopts ":wh" arg; do exit 1 ;; esac + shift done if [ "$WSL_SSH_AGENT" = true ]; then - SHLVL=0 exec ssh-agent "$SHELL" + if [ "$#" -gt 0 ]; then + SHLVL=0 exec ssh-agent "$SHELL" -c "$@" + else + SHLVL=0 exec ssh-agent "$SHELL" + fi fi require() { @@ -46,5 +51,8 @@ require npiperelay export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock [ -S "$SSH_AUTH_SOCK" ] && rm "$SSH_AUTH_SOCK" socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay -ei -s //./pipe/openssh-ssh-agent",nofork & -SHLVL=0 exec "$SHELL" - +if [ "$#" -gt 0 ]; then + SHLVL=0 exec "$SHELL" -c "$@" +else + SHLVL=0 exec "$SHELL" +fi