Merge pull request #19084 from jtkohl/watchcat-ping-bugfix

watchcat: fix broken ping invocation for no-address-family configuration
This commit is contained in:
Florian Eckert 2022-08-10 08:02:47 +02:00 committed by GitHub
commit 437f7a54ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=watchcat PKG_NAME:=watchcat
PKG_VERSION:=1 PKG_VERSION:=1
PKG_RELEASE:=16 PKG_RELEASE:=17
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com> PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View file

@ -137,12 +137,12 @@ watchcat_monitor_network() {
for host in $ping_hosts; do for host in $ping_hosts; do
if [ "$iface" != "" ]; then if [ "$iface" != "" ]; then
ping_result="$( ping_result="$(
ping "$ping_family" -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null ping $ping_family -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null
echo $? echo $?
)" )"
else else
ping_result="$( ping_result="$(
ping "$ping_family" -s "$ping_size" -c 1 "$host" &> /dev/null ping $ping_family -s "$ping_size" -c 1 "$host" &> /dev/null
echo $? echo $?
)" )"
fi fi
@ -218,12 +218,12 @@ watchcat_ping() {
for host in $ping_hosts; do for host in $ping_hosts; do
if [ "$iface" != "" ]; then if [ "$iface" != "" ]; then
ping_result="$( ping_result="$(
ping "$ping_family" -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null ping $ping_family -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null
echo $? echo $?
)" )"
else else
ping_result="$( ping_result="$(
ping "$ping_family" -s "$ping_size" -c 1 "$host" &> /dev/null ping $ping_family -s "$ping_size" -c 1 "$host" &> /dev/null
echo $? echo $?
)" )"
fi fi