blob: 2a1f17b3532940b22bb42b8e01a3ae3f32be7935 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env bash
if [ -z "$SERVER_ALIVE_INTERVAL" ];then
SERVER_ALIVE_INTERVAL=45
fi
if [ -z "$SERVER_ALIVE_COUNT_MAX" ];then
SERVER_ALIVE_COUNT_MAX=2
fi
if [ -z "$MONITORING_PORT" ];then
MONITORING_PORT=0
fi
/usr/bin/autossh -M "$MONITORING_PORT" \
-NCTv \
-o ServerAliveInterval="$SERVER_ALIVE_INTERVAL" \
-o ServerAliveCountMax="$SERVER_ALIVE_COUNT_MAX" \
-o TCPKeepAlive=yes \
-w $TUN_DEVICE:$TUN_DEVICE \
$HOST
|