| 1 | ### -*-sh-*- |
| 2 | |
| 3 | make_key_line () { |
| 4 | user=$1 |
| 5 | hosts="" |
| 6 | zone="" |
| 7 | while read u hh; do |
| 8 | case $u in "" | \#*) continue ;; esac |
| 9 | case $user in $u) ;; *) continue ;; esac |
| 10 | for h in $hh; do |
| 11 | case $h in |
| 12 | zone=*) zone=${h#*=} ;; |
| 13 | *) hosts=${hosts:+$hosts }$h ;; |
| 14 | esac |
| 15 | done |
| 16 | done <domains.conf |
| 17 | case ${hosts+t} in t) ;; *) continue ;; esac |
| 18 | line="environment=\"DYNDNS_HOST=$hosts\"" |
| 19 | line="$line${zone:+,environment=\"DYNDNS_ZONE=$zone\"}" |
| 20 | line="$line,command=\"bin/update\"" |
| 21 | echo "$line" |
| 22 | } |