-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·35 lines (31 loc) · 927 Bytes
/
entrypoint.sh
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
#!/bin/sh
touch /id_rsa
chmod 0400 /id_rsa
# Pick a random port above 32768
DEFAULT_PORT=$RANDOM
let "DEFAULT_PORT += 32768"
echo [INFO] Tunneling ${SSH_HOSTUSER:=root}@${SSH_HOSTNAME:=localhost}:${SSH_TUNNEL_REMOTE:=${DEFAULT_PORT}} to ${SSH_TUNNEL_HOST=localhost}:${SSH_TUNNEL_LOCAL:=22}
echo autossh \
-M ${SSH_M:=0} \
-o StrictHostKeyChecking=no \
-o ServerAliveInterval=5 \
-o ServerAliveCountMax=1 \
-t -4 \
-i /id_rsa \
-NR ${SSH_TUNNEL_REMOTE}:${SSH_TUNNEL_HOST}:${SSH_TUNNEL_LOCAL} \
-p ${SSH_HOSTPORT:=22} \
${SSH_HOSTUSER}@${SSH_HOSTNAME}
AUTOSSH_PIDFILE=/autossh.pid \
AUTOSSH_POLL=10 \
AUTOSSH_LOGLEVEL=0 \
AUTOSSH_LOGFILE=/dev/stdout \
autossh \
-M ${SSH_M:=0} \
-o StrictHostKeyChecking=no \
-o ServerAliveInterval=5 \
-o ServerAliveCountMax=1 \
-t -4 \
-i /id_rsa \
-NR ${SSH_TUNNEL_REMOTE}:${SSH_TUNNEL_HOST}:${SSH_TUNNEL_LOCAL} \
-p ${SSH_HOSTPORT:=22} \
${SSH_HOSTUSER}@${SSH_HOSTNAME}