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.
16 lines
490 B
16 lines
490 B
#!/bin/bash
|
|
# This file for openresty template
|
|
# Give only one argument with new user name
|
|
# This replace name of home directory and rename /var/www/yoursite to new username
|
|
# Also it change root path in nginx config
|
|
NEW_USER=$1
|
|
|
|
usermod --login ${NEW_USER} --move-home --home="/home/{$NEW_USER}" yoursite
|
|
|
|
mv /var/www/yoursite /var/www/${NEW_USER}
|
|
|
|
groupmod -n ${NEW_USER} yoursite
|
|
|
|
sed -i "s/yoursite/${NEW_USER}/" /opt/openresty/nginx/conf/conf.d/default.conf
|
|
|
|
systemctl reload openresty
|