You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1 System (kernel) timeouts may be very long (> 2 minutes). So the timeout will now be set explicitly to 30 seconds, i.e. if server is unavailable then wait only 1 minute for connecting (2 attempts).
Copy file name to clipboardExpand all lines: multi_server_stats.sh
+2-2
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,10 @@
20
20
fi
21
21
if! [[ -z"$PASS" ]];
22
22
then
23
-
CURR="$(sshpass -p $PASS ssh -p $PORT -tt -no StrictHostKeyChecking=accept-new $USER@$IP'vnstat --json h 2'| jq '.interfaces[0].traffic.hour[0].tx')"# first try ...
23
+
CURR="$(sshpass -p $PASS ssh -p $PORT -tt -o ConnectTimeout=30 -no StrictHostKeyChecking=accept-new $USER@$IP'vnstat --json h 2'| jq '.interfaces[0].traffic.hour[0].tx')"# first try ...
24
24
if [[ -z"$CURR" ]];# ... if not successful ...
25
25
then
26
-
CURR="$(sshpass -p $PASS ssh -p $PORT -tt -no StrictHostKeyChecking=accept-new $USER@$IP'vnstat --json h 2'| jq '.interfaces[0].traffic.hour[0].tx')"# ... do the second try to eliminate possible intermittent connection problem
26
+
CURR="$(sshpass -p $PASS ssh -p $PORT -tt -o ConnectTimeout=30 -no StrictHostKeyChecking=accept-new $USER@$IP'vnstat --json h 2'| jq '.interfaces[0].traffic.hour[0].tx')"# ... do the second try to eliminate possible intermittent connection problem
0 commit comments