replace single brackets by double ones (more modern style)

This commit is contained in:
Benedikt Geißler 2016-04-21 23:31:04 +02:00
parent cfc96da133
commit 899af06837

View File

@ -37,7 +37,7 @@ if ls $(dirname $0)/nsupdate.d/*.config &> /dev/null; then
# Loop through configs # Loop through configs
for f in $(dirname $0)/nsupdate.d/*.config for f in $(dirname $0)/nsupdate.d/*.config
do do
if [ "$SILENT" == "NO" ]; then if [[ "$SILENT" == "NO" ]]; then
echo "Starting nameserver update with config file $f" echo "Starting nameserver update with config file $f"
fi fi
## Set record type to IPv4 ## 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}') NSLOOKUP=$(drill $DOMAIN @ns.inwx.de $TYPE | head -7 | tail -1 | awk '{print $5}')
fi fi
else 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) PART_NSLOOKUP=$(nslookup -sil -type=$TYPE $DOMAIN - ns.inwx.de | tail -2 | head -1 | cut -d' ' -f5)
NSLOOKUP=${PART_NSLOOKUP%"."} NSLOOKUP=${PART_NSLOOKUP%"."}
else else
@ -113,8 +113,8 @@ if ls $(dirname $0)/nsupdate.d/*.config &> /dev/null; then
</param> </param>
</params> </params>
</methodCall>" </methodCall>"
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/ 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 echo "$(date) - $DOMAIN updated. Old IP: "$NSLOOKUP "New IP: "$WAN_IP >> $LOG
elif [ "$SILENT" == "NO" ]; then elif [ "$SILENT" == "NO" ]; then