mirror of
https://github.com/ThunixdotNet/makeuser.git
synced 2026-01-24 13:40:17 +00:00
sub new users to the mailing list
This commit is contained in:
8
makeuser
8
makeuser
@@ -16,6 +16,13 @@ usage() {
|
|||||||
echo -e "usage: $PROGNAME [-h|--help] <username> <email> \"<pubkey>\""
|
echo -e "usage: $PROGNAME [-h|--help] <username> <email> \"<pubkey>\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub_to_list() {
|
||||||
|
echo "
|
||||||
|
From: $1
|
||||||
|
Subject: subscribe
|
||||||
|
" | sudo -u $1 sendmail tildeteam-join@lists.tildeverse.org
|
||||||
|
}
|
||||||
|
|
||||||
[[ $(id -u) != 0 ]] && error_exit "you must be the superuser to run this script."
|
[[ $(id -u) != 0 ]] && error_exit "you must be the superuser to run this script."
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -31,6 +38,7 @@ case $1 in
|
|||||||
useradd -m -g 100 -p $pwcrypt -s /bin/bash $1 || exit 1
|
useradd -m -g 100 -p $pwcrypt -s /bin/bash $1 || exit 1
|
||||||
|
|
||||||
sed -e "s/newusername/$1/g" -e "s/newpassword/$newpw/" email.tmpl | sendmail $1 $2 sudoers@tilde.team
|
sed -e "s/newusername/$1/g" -e "s/newpassword/$newpw/" email.tmpl | sendmail $1 $2 sudoers@tilde.team
|
||||||
|
sub_to_list $1
|
||||||
|
|
||||||
echo "$3" | tee /home/$1/.ssh/authorized_keys
|
echo "$3" | tee /home/$1/.ssh/authorized_keys
|
||||||
toot "welcome new user ~$1!" ;;
|
toot "welcome new user ~$1!" ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user