File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ max-clients 10
13
13
EOF
14
14
15
15
SERV_IP=$( ip -4 -o addr show scope global | awk ' {print $4}' | sed -e ' s:/.*::' | head -n1)
16
- ovpn_genconfig -u udp://$SERV_IP -f 1400 -e " $MULTILINE_EXTRA_SERVER_CONF " -e ' duplicate-cn' -e ' topology subnet' -p ' route 172.22.22.0 255.255.255.0'
16
+ ovpn_genconfig -u udp://$SERV_IP -f 1400 -k ' 60 300 ' - e " $MULTILINE_EXTRA_SERVER_CONF " -e ' duplicate-cn' -e ' topology subnet' -p ' route 172.22.22.0 255.255.255.0'
17
17
18
18
#
19
19
# grep for config lines from openvpn.conf
@@ -65,6 +65,11 @@ CONFIG_MATCH_DEFAULT_DNS_1=$(busybox grep 'push dhcp-option DNS 8.8.8.8' /etc/op
65
65
CONFIG_REQUIRED_DEFAULT_DNS_2=" ^push dhcp-option DNS 8.8.4.4"
66
66
CONFIG_MATCH_DEFAULT_DNS_2=$( busybox grep ' push dhcp-option DNS 8.8.4.4' /etc/openvpn/openvpn.conf)
67
67
68
+ # # Test for keepalive
69
+ # 11. keepalive config
70
+ CONFIG_REQUIRED_KEEPALIVE=" ^keepalive 60 300"
71
+ CONFIG_MATCH_KEEPALIVE=$( busybox grep keepalive /etc/openvpn/openvpn.conf)
72
+
68
73
69
74
#
70
75
# Tests
@@ -148,6 +153,13 @@ else
148
153
abort " ==> Config match not found: $CONFIG_REQUIRED_DEFAULT_DNS_2 != $CONFIG_MATCH_DEFAULT_DNS_2 "
149
154
fi
150
155
156
+ if [[ $CONFIG_MATCH_KEEPALIVE =~ $CONFIG_REQUIRED_KEEPALIVE ]]
157
+ then
158
+ echo " ==> Config match found: $CONFIG_REQUIRED_KEEPALIVE == $CONFIG_MATCH_KEEPALIVE "
159
+ else
160
+ abort " ==> Config match not found: $CONFIG_REQUIRED_KEEPALIVE != $CONFIG_MATCH_KEEPALIVE "
161
+ fi
162
+
151
163
SERV_IP=$( ip -4 -o addr show scope global | awk ' {print $4}' | sed -e ' s:/.*::' | head -n1)
152
164
ovpn_genconfig -u udp://$SERV_IP -r " 172.33.33.0/24" -r " 172.34.34.0/24"
153
165
You can’t perform that action at this time.
0 commit comments