Modify gpg/ssh forwarding stuff

This commit is contained in:
David Holland 2022-05-31 21:35:30 +02:00
parent adc8d7a219
commit 2a2e309e33
Signed by: DustVoice
GPG Key ID: 47068995A14EDCA9
2 changed files with 46 additions and 4 deletions

View File

@ -2,5 +2,5 @@ Host archserver
HostName pc.dustvoice.de
ForwardAgent yes
ForwardX11 yes
RemoteForward /run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra
RemoteForward /run/user/1000/gnupg/S.gpg-agent.ssh /run/user/1000/gnupg/S.gpg-agent.ssh
RemoteForward /run/user/1000/gnupg/S.gpg-agent /home/dustvoice/.gnupg/S.gpg-agent.extra
RemoteForward /run/user/1000/gnupg/S.gpg-agent.ssh /home/dustvoice/.gnupg/S.gpg-agent.ssh

View File

@ -41,7 +41,7 @@ alias resolve='/opt/resolve/bin/resolve'
# ======
# ======
# Pianoteq 6
# Pianoteq 7
# ======
alias pianoteq='pianoteq\ 7'
# ======
@ -126,7 +126,7 @@ function check-iommu-func() {
alias check-iommu='check-iommu-func'
function battery-monitor-func() {
watch -t -n 60 '( if [ $(cat /sys/class/power_supply/ACAD/online) == "1" ]; then printf "Power connected\n"; else printf "Power disconnected\n"; fi; printf "\nBattery capacity: "; cat /sys/class/power_supply/BAT1/capacity; printf "\n(Updated every 60s)"; )';
watch1 -t -n 60 '( if [ $(cat /sys/class/power_supply/ACAD/online) == "1" ]; then printf "Power connected\n"; else printf "Power disconnected\n"; fi; printf "\nBattery capacity: "; cat /sys/class/power_supply/BAT1/capacity; printf "\n(Updated every 60s)"; )';
}
alias battery-monitor='battery-monitor-func'
@ -161,3 +161,45 @@ function bspwm-load-func() {
alias bspwm-save="bspwm-save-func workspaces workspaces.prev_save"
alias bspwm-load="bspwm-load-func workspaces workspaces.prev_load"
# ===
# ===
# Hyper-V agents forwarding
# ===
function hyperv-gpg-agent() {
socket_path="$HOME/.gnupg/S.gpg-agent"
host_ip=$(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
if [[ -f $socket_path ]]; then
rm $socket_path
fi
(setsid socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59545)
}
function hyperv-gpg-agent-extra() {
socket_path="$HOME/.gnupg/S.gpg-agent.extra"
host_ip=$(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
if [[ -f $socket_path ]]; then
rm $socket_path
fi
(setsid socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59544)
}
function hyperv-ssh-agent() {
#socket_path="$HOME/.gnupg/S.gpg-agent.ssh"
socket_path="$HOME/.ssh/agent.sock"
host_ip=$(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
if [[ -f $socket_path ]]; then
rm $socket_path
fi
(setsid socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59546)
}
function hyperv-agents() {
hyperv-gpg-agent
#hyperv-gpg-agent-extra
hyperv-ssh-agent
}
alias hyperv-gpg-forward="hyperv-gpg-agent"
alias hyperv-ssh-forward="hyperv-ssh-agent"
alias hyperv-forward="hyperv-agents"
# ===