Revision 45d078c5
Added by Jim Pingle over 7 years ago
src/usr/local/bin/ping_hosts.sh | ||
---|---|---|
29 | 29 |
# Field 8: Address family |
30 | 30 |
|
31 | 31 |
# Read in ipsec ping hosts and check the CARP status |
32 |
if [ -f /var/db/ipsecpinghosts ]; then |
|
32 |
# Only perform this check if there are IPsec hosts to ping, see |
|
33 |
# https://redmine.pfsense.org/issues/8172 |
|
34 |
if [ -f /var/db/ipsecpinghosts -a -s /var/db/ipsecpinghosts ]; then |
|
33 | 35 |
IPSECHOSTS="/var/db/ipsecpinghosts" |
34 | 36 |
CURRENTIPSECHOSTS="/var/db/currentipsecpinghosts" |
35 | 37 |
IFVPNSTATE=`ifconfig $IFVPN | grep "carp: BACKUP vhid" | wc -l` |
... | ... | |
53 | 55 |
PKGHOSTS="/var/db/pkgpinghosts" |
54 | 56 |
fi |
55 | 57 |
|
56 |
cat $PKGHOSTS $HOSTS $CURRENTIPSECHOSTS >/tmp/tmpHOSTS |
|
58 |
# Make sure at least one of these has contents, otherwise cat will be stuck waiting on input |
|
59 |
if [ ! -z "${PKGHOSTS}" -o ! -z "${HOSTS}" -o ! -z "${CURRENTIPSECHOSTS}" ]; then |
|
60 |
cat $PKGHOSTS $HOSTS $CURRENTIPSECHOSTS >/tmp/tmpHOSTS |
|
61 |
else |
|
62 |
# Nothing to do! |
|
63 |
exit |
|
64 |
fi |
|
57 | 65 |
|
58 | 66 |
if [ ! -d /var/db/pingstatus ]; then |
59 | 67 |
/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