1
0
fai-configspace/scripts/SETUP_USER/10-setup-user

21 lines
526 B
Bash
Executable File

#! /bin/bash
# (c) Thomas Lange, 2001-2017, lange@debian.org
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
echo "SETUP USER: $username";
# add additional user account
if [ -n "$username" ]; then
if ! $ROOTCMD getent passwd $username ; then
$ROOTCMD adduser --disabled-login --gecos "$username user" $username
$ROOTCMD usermod -p "$USERPW" $username
userdir=$($ROOTCMD getent passwd "$username" | cut -d: -f6 )
for g in $groups; do
$ROOTCMD adduser $username $g
done
fi
fi