Add grml-live script
[grml-live.git] / etc / grml / fai / config / scripts / GRML / 21-usersetup
1 #!/bin/sh
2 set -u
3 set -e
4
5 USERNAME=''
6 [ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
7 [ -n "$USERNAME" ] || USERNAME=grml
8
9 chroot "$target" addgroup --gid 1000 $USERNAME
10 chroot "$target" useradd -d /home/$USERNAME -m -s /bin/zsh -g 1000 $USERNAME
11
12 sed -i 's/^root::/root:*:/' "$target"/etc/shadow
13 sed -i 's/^$USERNAME::/$USERNAME:*:/' "$target"/etc/shadow
14
15 chroot "$target" chsh -s /bin/zsh root
16 chroot "$target" chsh -s /bin/zsh $USERNAME