2022-09-06 16:29:06 +02:00
|
|
|
function hyperv-gpg-agent
|
|
|
|
set socket_path "$HOME/.gnupg/S.gpg-agent"
|
|
|
|
set host_ip $(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
|
|
|
|
|
|
|
|
if test -e $socket_path
|
|
|
|
rm $socket_path
|
|
|
|
end
|
|
|
|
|
2022-09-06 16:49:08 +02:00
|
|
|
screen -dmS gpg-socat socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59545
|
2022-09-06 16:29:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function hyperv-ssh-agent
|
|
|
|
set socket_path "$HOME/.gnupg/S.gpg-agent.ssh"
|
|
|
|
set host_ip $(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
|
|
|
|
|
|
|
|
if test -e $socket_path
|
|
|
|
rm $socket_path
|
|
|
|
end
|
2022-09-06 16:49:08 +02:00
|
|
|
screen -dmS ssh-socat socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59546
|
2022-09-06 16:29:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function hyperv-forward --description 'Setup hyperv-agent forwarding'
|
|
|
|
hyperv-gpg-agent
|
|
|
|
hyperv-ssh-agent
|
|
|
|
end
|