X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FDEBIAN%2F10-rootpw;h=539f2eb6c3badfe173022b0f7fc0e05959bdfebd;hb=591c84435e22df12f2b5121c08578bff7c6bb047;hp=c1ee0b18f725043592835d9091eef6e53b60c7e5;hpb=056eb4e90e13b2d8f7cbb8c3b875f35bf0fa207e;p=automated-distro-installer diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index c1ee0b1..539f2eb 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -3,6 +3,10 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # set root password -$ROOTCMD usermod -p "$ROOTPW" root +if [ -n "$ROOTPW" ]; then + $ROOTCMD chpasswd --encrypted <<< "root:${ROOTPW}" +elif [ -n "$username" ]; then + $ROOTCMD usermod -L root +fi exit $error