浏览代码

Itterate through freedns codes

Bob Mottram 7 年前
父节点
当前提交
c3895f3fb5
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2
    3
      src/freedombone-freedns

+ 2
- 3
src/freedombone-freedns 查看文件

53
 
53
 
54
 detected_codes=()
54
 detected_codes=()
55
 codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
55
 codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
56
-for line in "${codelines[@]}"
57
-do
56
+while read -r line; do
58
     code=$(echo "$line" | awk -F '=' '{print $2}')
57
     code=$(echo "$line" | awk -F '=' '{print $2}')
59
     if [ $VERBOSE ]; then
58
     if [ $VERBOSE ]; then
60
         echo $"freedns code $code"
59
         echo $"freedns code $code"
63
     if [[ $? != 0 ]]; then
62
     if [[ $? != 0 ]]; then
64
         detected_codes+=("$code")
63
         detected_codes+=("$code")
65
     fi
64
     fi
66
-done
65
+done <<< "$codelines"
67
 
66
 
68
 if [ ! -d $HOME/.freedns-update ]; then
67
 if [ ! -d $HOME/.freedns-update ]; then
69
     mkdir $HOME/.freedns-update
68
     mkdir $HOME/.freedns-update