Browse Source

Added dryrun variable

Corrected bug in direct IPv6 detection
pull/1/head
Julien Escario 4 years ago
parent
commit
153ffa8947
  1. 12
      monitoring/altinea_monitoring_request.sh

12
monitoring/altinea_monitoring_request.sh

@ -23,7 +23,7 @@ if [ -z "$EXTIP4" ]; then
EXTIP4='dummy' EXTIP4='dummy'
fi fi
if [ -z "$EXTIP6" ]; then if [ -z "$EXTIP6" ]; then
EXTIP4='dummy'
EXTIP6='dummy'
fi fi
# Check if found IPv4 address is configured on this server # Check if found IPv4 address is configured on this server
@ -43,7 +43,7 @@ else
fi fi
# Same routine for IPv6 # Same routine for IPv6
if [ $(hostname -I |grep -c '$EXTIP6') -ne 0 ]; then
if [ $(hostname -I |grep -c $EXTIP6) -ne 0 ]; then
IP6=$EXTIP6 IP6=$EXTIP6
else else
DEBUG echo "Couldn't find a public IPv6 address on this host" DEBUG echo "Couldn't find a public IPv6 address on this host"
@ -75,5 +75,11 @@ else
COMMAND="$COMMAND IPv6 : $IP6\n" COMMAND="$COMMAND IPv6 : $IP6\n"
fi fi
COMMAND="$COMMAND -o tls=no -o message-charset=UTF-8 -s zpush.altinea.fr"
# And run the request by mail # And run the request by mail
$COMMAND -o tls=no -o message-charset=UTF-8 -s zpush.altinea.fr
if [ "$_DRYRUN" = "on" ]; then
echo $COMMAND
else
$COMMAND
fi
Loading…
Cancel
Save