Kaynağa Gözat

Itterate through freedns codes

Bob Mottram 8 yıl önce
ebeveyn
işleme
c3895f3fb5
1 değiştirilmiş dosya ile 2 ekleme ve 3 silme
  1. 2
    3
      src/freedombone-freedns

+ 2
- 3
src/freedombone-freedns Dosyayı Görüntüle

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