File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/expect -f
2
2
3
- set timeout 5
3
+ set timeout $env(VPNTIMEOUT)
4
4
5
5
spawn "/usr/share/forticlient/opt/forticlient-sslvpn/64bit/forticlientsslvpn_cli" --server $env(VPNADDR) --vpnuser $env(VPNUSER) --keepalive
6
6
@@ -19,7 +19,7 @@ expect -exact "Would you like to connect to this server? (Y/N)" {
19
19
expect {
20
20
"STATUS::Tunnel running" {
21
21
} timeout {
22
- send_user -- "Failed to bring tunnel up after 10s \n"
22
+ send_user -- "Failed to bring tunnel up after $env(VPNTIMEOUT)s \n"
23
23
exit 1
24
24
}
25
25
}
@@ -34,4 +34,3 @@ expect {
34
34
exit
35
35
}
36
36
}
37
-
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ if [ -z "$VPNADDR" -o -z "$VPNUSER" -o -z "$VPNPASS" ]; then
4
4
echo " Variables VPNADDR, VPNUSER and VPNPASS must be set." ; exit ;
5
5
fi
6
6
7
+ export VPNTIMEOUT=${VPNTIMEOUT:- 5}
8
+
7
9
# Setup masquerade, to allow using the container as a gateway
8
10
for iface in $( ip a | grep eth | grep inet | awk ' {print $2}' ) ; do
9
11
iptables -t nat -A POSTROUTING -s " $iface " -j MASQUERADE
You can’t perform that action at this time.
0 commit comments