generate_zone.sh 506 B

12345678910111213141516171819
  1. #!/bin/sh
  2. cp ${WORKSPACE}/template.infoclinica.lan.zone ${WORKSPACE}/infoclinica.lan.zone
  3. cd ${OVPN_GIT_NAME}/${OVPN_GIT_NAME}/ccd
  4. IFS=$'\n'
  5. for i in `ls`
  6. do
  7. file=$(echo -n ${i}|sed 's/ /-/g'|sed 's/\./-/g'|tr '[:upper:]' '[:lower:]')
  8. j=$(grep -o "10\.10\.20\.[0-9]\{1,3\}" ${i})
  9. if [ -z ${j} ]
  10. then
  11. echo ${j}
  12. else
  13. echo -e "${file}\tIN\tA\t${j}" >> ${WORKSPACE}/infoclinica.lan.zone
  14. fi
  15. done
  16. sed -i "s/.*; serial.*/ $1 ; serial/" ${WORKSPACE}/infoclinica.lan.zone