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