v-update-dns-templates 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # info: update dns templates
  3. # options: [RESTART]
  4. #
  5. # The function for obtaining updated pack of dns templates.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. restart=$1
  11. # Includes
  12. source $VESTA/func/main.sh
  13. source $VESTA/conf/vesta.conf
  14. #----------------------------------------------------------#
  15. # Action #
  16. #----------------------------------------------------------#
  17. # Get new archive
  18. tmpdir=$(mktemp -d --dry-run)
  19. mkdir $tmpdir
  20. cd $tmpdir
  21. wget http://c.vestacp.com/rhel/7/templates.tar.gz -q
  22. if [ "$?" -ne 0 ]; then
  23. echo "Error: can't download template.tar.gz"
  24. log_event "$E_CONNECT" "$ARGUMENTS"
  25. rm -rf $tmpdir
  26. exit $E_CONNECT
  27. fi
  28. # Update templates
  29. tar -xzpf templates.tar.gz -C $VESTA/data/ templates/dns
  30. #----------------------------------------------------------#
  31. # Vesta #
  32. #----------------------------------------------------------#
  33. # Clean tmpdir
  34. rm -rf $tmpdir
  35. exit