add: fish config file for linux and npiperelay
This commit is contained in:
parent
f7c456fbd1
commit
3d14d339b4
2 changed files with 26 additions and 0 deletions
6
.config/fish/config-linux.fish
Normal file
6
.config/fish/config-linux.fish
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#x-server
|
||||||
|
set -g DISPLAY $(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
|
||||||
|
|
||||||
|
if test -x (command -v npiperelay.exe)
|
||||||
|
source (dirname (status --current-file))/config-npiperelay.fish
|
||||||
|
end
|
||||||
20
.config/fish/config-npiperelay.fish
Normal file
20
.config/fish/config-npiperelay.fish
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Configure ssh forwarding
|
||||||
|
set -x SSH_AUTH_SOCK $HOME/.ssh/agent.sock
|
||||||
|
|
||||||
|
# use square brackets to generate a regex match for the process we want but that doesn't match the grep command running it!
|
||||||
|
set ALREADY_RUNNING (ps -aux | grep -q "[n]piperelay.exe -ei -s //./pipe/openssh-ssh-agent"; echo $status)
|
||||||
|
|
||||||
|
if [ $ALREADY_RUNNING -ne 0 ]
|
||||||
|
if [ -S $SSH_AUTH_SOCK ]
|
||||||
|
# not expecting the socket to exist as the forwarding command isn't running (http://www.tldp.org/LDP/abs/html/fto.html)
|
||||||
|
# echo "removing previous socket..."
|
||||||
|
rm $SSH_AUTH_SOCK
|
||||||
|
end
|
||||||
|
|
||||||
|
# echo "Starting SSH-Agent relay..."
|
||||||
|
# setsid to force new session to keep running
|
||||||
|
# set socat to listen on $SSH_AUTH_SOCK and forward to npiperelay which then forwards to openssh-ssh-agent on windows
|
||||||
|
begin
|
||||||
|
setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork >/dev/null 2>&1 &
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue