Revision f6e83ca2
Added by Jim Pingle over 7 years ago
src/usr/local/bin/ping_hosts.sh | ||
---|---|---|
61 | 61 |
# Field 8: Address family |
62 | 62 |
|
63 | 63 |
# Read in ipsec ping hosts and check the CARP status |
64 |
if [ -f /var/db/ipsecpinghosts ]; then |
|
64 |
# Only perform this check if there are IPsec hosts to ping, see |
|
65 |
# https://redmine.pfsense.org/issues/8172 |
|
66 |
if [ -f /var/db/ipsecpinghosts -a -s /var/db/ipsecpinghosts ]; then |
|
65 | 67 |
IPSECHOSTS="/var/db/ipsecpinghosts" |
66 | 68 |
CURRENTIPSECHOSTS="/var/db/currentipsecpinghosts" |
67 | 69 |
IFVPNSTATE=`ifconfig $IFVPN | grep "carp: BACKUP vhid" | wc -l` |
... | ... | |
85 | 87 |
PKGHOSTS="/var/db/pkgpinghosts" |
86 | 88 |
fi |
87 | 89 |
|
88 |
cat $PKGHOSTS $HOSTS $CURRENTIPSECHOSTS >/tmp/tmpHOSTS |
|
90 |
# Make sure at least one of these has contents, otherwise cat will be stuck waiting on input |
|
91 |
if [ ! -z "${PKGHOSTS}" -o ! -z "${HOSTS}" -o ! -z "${CURRENTIPSECHOSTS}" ]; then |
|
92 |
cat $PKGHOSTS $HOSTS $CURRENTIPSECHOSTS >/tmp/tmpHOSTS |
|
93 |
else |
|
94 |
# Nothing to do! |
|
95 |
exit |
|
96 |
fi |
|
89 | 97 |
|
90 | 98 |
if [ ! -d /var/db/pingstatus ]; then |
91 | 99 |
/bin/mkdir -p /var/db/pingstatus |
Also available in: Unified diff
Skip IPsec ping host CARP check when there are no IPSec ping hosts. Also, add a safety belt so cat can't get stuck waiting on input. Fixes #8172
(cherry picked from commit 45d078c5964b94dd2aa7f1a609fcb47e89eaac49)