Skip to content

Commit 14d9549

Browse files
committed
Allow configuring the VPN init timeout
1 parent 0419489 commit 14d9549

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

forticlient

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/expect -f
22

3-
set timeout 5
3+
set timeout $env(VPNTIMEOUT)
44

55
spawn "/usr/share/forticlient/opt/forticlient-sslvpn/64bit/forticlientsslvpn_cli" --server $env(VPNADDR) --vpnuser $env(VPNUSER) --keepalive
66

@@ -19,7 +19,7 @@ expect -exact "Would you like to connect to this server? (Y/N)" {
1919
expect {
2020
"STATUS::Tunnel running" {
2121
} 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"
2323
exit 1
2424
}
2525
}
@@ -34,4 +34,3 @@ expect {
3434
exit
3535
}
3636
}
37-

start.sh

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ if [ -z "$VPNADDR" -o -z "$VPNUSER" -o -z "$VPNPASS" ]; then
44
echo "Variables VPNADDR, VPNUSER and VPNPASS must be set."; exit;
55
fi
66

7+
export VPNTIMEOUT=${VPNTIMEOUT:-5}
8+
79
# Setup masquerade, to allow using the container as a gateway
810
for iface in $(ip a | grep eth | grep inet | awk '{print $2}'); do
911
iptables -t nat -A POSTROUTING -s "$iface" -j MASQUERADE

0 commit comments

Comments
 (0)