Browse Source

freedns updater improvements

Bob Mottram 7 years ago
parent
commit
c6262e7e3e
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      src/freedombone-freedns

+ 7
- 5
src/freedombone-freedns View File

35
 
35
 
36
 VERBOSE=
36
 VERBOSE=
37
 CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
37
 CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
38
-FREEDNS_WGET='wget -q --read-timeout=0.0 --waitretry=5 --tries=4 https://freedns.afraid.org/dynamic/update.php?'
38
+FREEDNS_WGET='wget --read-timeout=0.0 --waitretry=5 --tries=4 https://freedns.afraid.org/dynamic/update.php?'
39
 
39
 
40
 if [[ "$1" == "--verbose" || "$1" == "-v" ]]; then
40
 if [[ "$1" == "--verbose" || "$1" == "-v" ]]; then
41
     VERBOSE=1
41
     VERBOSE=1
55
 codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
55
 codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
56
 while read -r line; do
56
 while read -r line; do
57
     code=$(echo "$line" | awk -F '=' '{print $2}')
57
     code=$(echo "$line" | awk -F '=' '{print $2}')
58
-    if [ $VERBOSE ]; then
59
-        echo $"freedns code $code"
60
-    fi
61
     item_in_array "$code" "${detected_codes[@]}"
58
     item_in_array "$code" "${detected_codes[@]}"
62
     if [[ $? != 0 ]]; then
59
     if [[ $? != 0 ]]; then
63
         detected_codes+=("$code")
60
         detected_codes+=("$code")
70
 cd $HOME/.freedns-update
67
 cd $HOME/.freedns-update
71
 for code in "${detected_codes[@]}"
68
 for code in "${detected_codes[@]}"
72
 do
69
 do
73
-    $FREEDNS_WGET${code}
70
+    if [ $VERBOSE ]; then
71
+        echo $"command: $FREEDNS_WGET${code}="
72
+        $FREEDNS_WGET${code}=
73
+    else
74
+        $FREEDNS_WGET${code}= >> /tmp/freedns 2>&1
75
+    fi
74
 done
76
 done
75
 
77
 
76
 exit 0
78
 exit 0