summaryrefslogtreecommitdiff
path: root/bin/remhelp
blob: 76c17be68b63171c3546289790758190256fb94e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/zsh

# This script is intended to help other users.
# It launches an SSH-Tunnel to necoro.eu and makes it forward connections to port 5500
# (yes! this does not need any firewall hackering)
#
# Ideally used with an VNC-Exe generated by http://www.heise.de/netze/tools/fernwartung
#
# Needs locally: net-misc/ssvnc
# (I couldn't get it to work with any other vncviewer)

autoload -U colors
colors

log () {
		echo ${fg_bold[white]}">> $1"${reset_color}
	}

cont=

TRAPINT () {
    log "Interrupting..."
    cont=x
}

log "Adding SSH-Key"
ssh-add

if [[ -z $cont ]]; then
    log "Setting up port forwarding"
    coproc ssh -tt -R :5500:localhost:5500 necoro@necoro.eu

    log "Starting listening process"
    /usr/lib64/ssvnc/vncviewer -noraiseonbeep -encodings "copyrect tight zrle zlib hextile" -listen 0

    log "Sending 'exit' to SSH-Connection"
    print -p exit

    log "Removing SSH-Key"
    ssh-add -d
fi