You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
490 B

  1. #!/bin/bash
  2. # This file for openresty template
  3. # Give only one argument with new user name
  4. # This replace name of home directory and rename /var/www/yoursite to new username
  5. # Also it change root path in nginx config
  6. NEW_USER=$1
  7. usermod --login ${NEW_USER} --move-home --home="/home/{$NEW_USER}" yoursite
  8. mv /var/www/yoursite /var/www/${NEW_USER}
  9. groupmod -n ${NEW_USER} yoursite
  10. sed -i "s/yoursite/${NEW_USER}/" /opt/openresty/nginx/conf/conf.d/default.conf
  11. systemctl reload openresty