X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FDEBIAN%2F10-rootpw;h=329e2f6220caa87a16eaf66a13f4937e60d43e5e;hp=bb77d1a30f5fe0eb2df8dc43d5abbfc8b80dcdb3;hb=490334746631a6c956eee47947f3ab8f8a451666;hpb=7ade5e2c6113530c5f99cfc95880897fcb479f39 diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index bb77d1a..329e2f6 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -4,11 +4,14 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # set root password if [ -n "$ROOTPW" ]; then - $ROOTCMD usermod -p "$ROOTPW" root -else + $ROOTCMD chpasswd --encrypted <<< "root:${ROOTPW}" +elif [ -n "$username" ]; then $ROOTCMD usermod -L root # enable sudo for user ainsl /etc/sudoers "$username ALL = ALL" + if [ ! -f $target/usr/bin/sudo ]; then + echo "WARNING. Package sudo is not installed" + fi fi exit $error