Para o registro, eu fui com:
#! /usr/local/bin/bash
clear
echo "--------------------------------------------------"
echo " "
echo " Welcome to FreeBSD community server! "
echo " "
echo "--------------------------------------------------"
echo
echo To create a new account enter your album number:
read ALBUM
if [ -d "/home/$ALBUM" ]; then
echo ""
echo "User already exists!"
echo ""
read
exit
else
PASSWORD='cat /dev/urandom |tr -cd A-Za-z0-9 | head -c 8'
echo "Your FreeBSD server password is:
$PASSWORD
If you did not request one, ignore this message." | mail -s "Auth Credentials" [email protected]
echo ""
echo "Thank you, a new user has been created and a mail containing your password"
echo "was sent to [email protected]"
echo ""
sudo pw useradd $ALBUM -d /home/$ALBUM -s /usr/local/bin/bash -m
echo $PASSWORD | sudo pw mod user $ALBUM -h 0
read
exit
fi