Enable new users to use CVS, and access to Gemini and Gopher

Signed-off-by: Shin'ya Minazuki <shinyoukai@laidback.moe>
This commit is contained in:
2025-11-27 22:59:21 +09:00
parent 495ab854ac
commit 47361914cd

View File

@@ -23,6 +23,7 @@ case $1 in
;;
*)
if [ $# -ne 3 ]; then
print_usage
msg_err "Not enough arguments"
fi
@@ -35,17 +36,19 @@ case $1 in
newpw_hash="$(pwhash $newpw)"
msg_info "Adding new user: %s" "$1"
useradd -m -g users -s "${newpw_hash}" /bin/sh "$1" || msg_err "Unable to create user"
useradd -m -g users -G cvsadmin -s "${newpw_hash}" /bin/sh "$1" || msg_err "Unable to create user"
sed -e "s/newuser/$1/g" \
-e "s/newpassword/$newpw/" \
-e "s/newemail/$2/" \
-e "s/hostname/$hostname/" \
/usr/local/share/laidback/email.tmpl | sendmail "$1" "$2"
printf "%s\n" "$3" | doas tee "/home/$1/.ssh/authorized_keys"
doas -u ejabberd /usr/pkg/sbin/ejabberdctl register "$1" "${hostname}" "$newpw"
ln -s /home/$1/public_gopher /var/gopher/~$1
ln -s /home/$1/public_gemini /var/gemini/~$1
;;
esac