void-bash-installer/step4/20-users
2021-05-09 21:43:01 +02:00

25 lines
874 B
Plaintext

module "start" "users" "Configuring Users"
for i in $(seq 1 "${users[amount]}"); do
if ! cut -d: -f1 /etc/passwd | grep -q -w "${users[name$i]}"; then
useradd -G audio,video,floppy,cdrom,optical,input,users "${users[desc$i]}" -m -s "${users[shell$i]}" -U "${users[name$i]}"
if [[ "${users[sudo$i]}" == "1" ]]; then
usermod -a -G socklog,wheel "${users[name$i]}"
passwd -dl root
if grep -q lpadmin /etc/group; then
usermod -a -G lpadmin "${users[name$i]}"
fi
fi
echo password for "${users[name$i]}"
echo -e "${users[pw$i]}\n${users[pw$i]}" | passwd "${users[name$i]}"
#echo -e "oem\noem" | passwd "${users[name$i]}"
else
echo bereits in /etc/passwd vorhanden: "${users[name$i]}"
echo ueberspinge..
#fortfahren?
fi
done
module end