From 899af068379657ff48c00cd5653da1f17e205b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20Gei=C3=9Fler?= Date: Thu, 21 Apr 2016 23:31:04 +0200 Subject: [PATCH] replace single brackets by double ones (more modern style) --- nsupdate.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nsupdate.sh b/nsupdate.sh index bef8cc3..1a574a5 100755 --- a/nsupdate.sh +++ b/nsupdate.sh @@ -37,7 +37,7 @@ if ls $(dirname $0)/nsupdate.d/*.config &> /dev/null; then # Loop through configs for f in $(dirname $0)/nsupdate.d/*.config do - if [ "$SILENT" == "NO" ]; then + if [[ "$SILENT" == "NO" ]]; then echo "Starting nameserver update with config file $f" fi ## Set record type to IPv4 @@ -65,7 +65,7 @@ if ls $(dirname $0)/nsupdate.d/*.config &> /dev/null; then NSLOOKUP=$(drill $DOMAIN @ns.inwx.de $TYPE | head -7 | tail -1 | awk '{print $5}') fi else - if [[ "$TYPE" == "MX" ]]; then + if [[ "$TYPE" == "MX" ]]; then PART_NSLOOKUP=$(nslookup -sil -type=$TYPE $DOMAIN - ns.inwx.de | tail -2 | head -1 | cut -d' ' -f5) NSLOOKUP=${PART_NSLOOKUP%"."} else @@ -113,8 +113,8 @@ if ls $(dirname $0)/nsupdate.d/*.config &> /dev/null; then " - - if [ ! "$NSLOOKUP" == "$WAN_IP" ]; then + + if [[ "$NSLOOKUP" != "$WAN_IP" ]]; then curl -silent -v -XPOST -H"Content-Type: application/xml" -d "$API_XML" https://api.domrobot.com/xmlrpc/ echo "$(date) - $DOMAIN updated. Old IP: "$NSLOOKUP "New IP: "$WAN_IP >> $LOG elif [ "$SILENT" == "NO" ]; then