removed external email address from welcome email

This commit is contained in:
James Tomasino 2018-12-31 12:53:09 -05:00
parent f9812d236b
commit dcac3b6c47
1 changed files with 2 additions and 3 deletions

View File

@ -3,8 +3,7 @@
run_user=$(id -u)
if [ "$run_user" -eq 0 ]; then
n="$1"
e="$2"
k="$3"
k="$2"
if [ ! -z "$n" ]; then
user_exists=$(id -u "${n}" 2> /dev/null)
if [ -z "${user_exists}" ]; then
@ -12,7 +11,7 @@ if [ "$run_user" -eq 0 ]; then
newpw=$(pwgen -1B 10)
pwcrypt=$(perl -e "print crypt('${newpw}', 'sa');")
useradd -m -G users,www-data -p "$pwcrypt" -s /bin/bash "${n}" || exit 1
sed -e "s/newusername/${n}/g" -e "s/newpassword/${newpw}/" /etc/templates/welcomemail.tmpl | sendmail "${n}" "${e}" "tomasino"
sed -e "s/newusername/${n}/g" -e "s/newpassword/${newpw}/" /etc/templates/welcomemail.tmpl | sendmail "${n}" "tomasino"
fi
if [ ! -z "${k}" ]; then
printf "%s\\n" "${k}" >> "/home/${n}/.ssh/authorized_keys"