create-sock.inc 839 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. hestia_module_php_add() {
  3. source $HESTIA/bin/module/func.inc
  4. source $HESTIA/bin/module/php/func.inc
  5. if ! hestia_module_isinstalled 'php' && [ ! "$param_force" ]; then
  6. echo "PHP module is not installed. See 'hestia module info php'."
  7. return 1
  8. fi
  9. if [ ! "$param_template" ]; then
  10. param_template='default'
  11. fi
  12. if [ ! "$param_docroot" ]; then
  13. param_docroot='public_html'
  14. fi
  15. local pool_file=$(osal_php_fpm_pool_d $PHP_DEFAULT_VERSION)/${param_domain}.conf
  16. cat $HESTIA_INSTALL_DIR/php-fpm/${param_template}.tpl |\
  17. sed -e "s|%user%|$param_user|g"\
  18. -e "s|%apache_group%|$WEB_RGROUPS|g"\
  19. -e "s|%domain%|$param_domain|g"\
  20. -e "s|%domain%|$param_domain|g"\
  21. -e "s|%docroot%|$param_docroot|g" > $pool_file
  22. }