v-add-web-domain 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. #
  3. # !!! WRAPPER SCRIPT FOR COMPATIBILITY PURPOSES WITH OLD IPV4 SCRIPTS AND EXTERNAL CALLS !!!
  4. #
  5. # info: add web domain
  6. # options: USER DOMAIN [IPV4] [RESTART] [ALIASES] [PROXY_EXTENSIONS]
  7. #
  8. # example: v-add-web-domain admin wonderland.com 192.18.22.43 yes www.wonderland.com
  9. #
  10. # This function adds virtual host to a server. In cases when ip is
  11. # undefined in the script, "default" template will be used. The alias of
  12. # www.domain.tld type will be automatically assigned to the domain unless
  13. # "none" is transmited as argument. If ip have associated dns name, this
  14. # domain will also get the alias domain-tpl.$ipname. An alias with the ip
  15. # name is useful during the site testing while dns isn't moved to server yet.
  16. #----------------------------------------------------------#
  17. # Variables & Functions #
  18. #----------------------------------------------------------#
  19. # Argument definition
  20. user="$1"
  21. domain="$2"
  22. ip="$3"
  23. ipv6="" # EMPTY! Not used here, because of old IPV4 only mode
  24. restart="$4" # will be moved to the end soon
  25. aliases="$5"
  26. proxy_ext="$6"
  27. # Includes
  28. # shellcheck source=/etc/hestiacp/hestia.conf
  29. source /etc/hestiacp/hestia.conf
  30. ${HESTIA}/bin/v-add-web-domain-ipv46 "$user" "$domain" "$ip" "$ipv6" "$restart" "$aliases" "$proxy_ext"