fix_nginx_auth.sh 539 B

12345678910111213141516171819
  1. #!/bin/bash
  2. source /etc/profile.d/vesta.sh
  3. source /usr/local/vesta/conf/vesta.conf
  4. sed -i "s|web/%domain%/stats/auth.*|conf/web/%domain%.auth;|" \
  5. $VESTA/data/templates/web/nginx/*/*tpl >/dev/null 2>&1
  6. if [ "$WEB_SYSTEM" != 'nginx' ]; then
  7. exit
  8. fi
  9. check=`egrep "STATS_USER='([0-9]|[a-Z].*)'" $VESTA/data/users/*/web.conf`
  10. if [ ! -z "$check" ]; then
  11. for user in $(echo $check |cut -f1 -d: |cut -f7 -d/); do
  12. $VESTA/bin/v-rebuild-web-domains $user no >/dev/null 2>&1
  13. done
  14. $VESTA/bin/v-restart-service nginx
  15. fi