X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fdistro-install-common%2Fend;h=ec0d1cf9ad633ac60600b77394c579187c4ca32f;hb=845c2b9e9e7e25b3dfa3d7f750d0acae0e50caf4;hp=3d061b3445e961542562eccc59a813187c382528;hpb=ed3681256885d295f39d5df60784d3281a2f8719;p=automated-distro-installer diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end index 3d061b3..ec0d1cf 100755 --- a/fai/config/distro-install-common/end +++ b/fai/config/distro-install-common/end @@ -19,11 +19,10 @@ if [[ -e $src && -e $dst ]]; then fi USER2PW=/q/root/shadow/user2 -if ifclass ziva; then - ROOTPW=/q/root/shadow/ziva -else - # if doesn't exist, we dont set one - ROOTPW=/q/root/shadow/standard +# if doesn't exist, we dont set one +ROOTPW=/q/root/shadow/standard +if [[ ! -e $ROOTPW ]]; then + ROOTPW=/q/root/shadow/$HOSTNAME fi chpw() { @@ -42,8 +41,9 @@ chpw() { fi } au() { # add user. i don't use adduser for portability - if ! $ROOTCMD getent passwd ${@: -1}; then - $ROOTCMD useradd -Um -s /bin/bash $@ + local user=${@: -1} + if ! $ROOTCMD getent passwd $user; then + $ROOTCMD useradd -c $user -Um -s /bin/bash $@ fi }