X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FDEBIAN%2F10-rootpw;h=bb77d1a30f5fe0eb2df8dc43d5abbfc8b80dcdb3;hb=f8e7e925a0eba5b0091354ccf26842bcfda9b84e;hp=fe08f9d029d4813141a76691843d38a4a698244c;hpb=3bd65f0ca635f1349626c2393a4dd8a50df64f54;p=automated-distro-installer diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index fe08f9d..bb77d1a 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -3,6 +3,12 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # set root password -$ROOTCMD usermod -p $ROOTPW root +if [ -n "$ROOTPW" ]; then + $ROOTCMD usermod -p "$ROOTPW" root +else + $ROOTCMD usermod -L root + # enable sudo for user + ainsl /etc/sudoers "$username ALL = ALL" +fi exit $error