Browse Source

+ prepare new linux user for openresty template

master
gitea 4 years ago
parent
commit
35db3b71ba
  1. 16
      new-user.sh

16
new-user.sh

@ -0,0 +1,16 @@
#!/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
Loading…
Cancel
Save